@villedemontreal/workit-zeebe-client
v5.0.2
Published
Zeebe client for WorkIt that works with Zeebe platform powered by TypeScript
Downloads
6
Readme
WorkIt Zeebe Client
Installing
npm i workit-zeebe-client
How to use
const config = {
maxTasks: 32,
workerId: 'test-worker',
baseUrl: `localhost:26500`,
topicName: 'demo-service',
bpmnKey: 'BPMN_DEMO'
};
const client = new ZeebeClient(config);
await client.deployWorkflow('deploy-your.bpmn');
await client.createWorkflowInstance({
bpmnProcessId: "BPMN_DEMO",
variables: {
amount: 1000,
hello: "world"
}
});
await client.subscribe(async (message, service) => {
// do something
});
Start a worker
import { NoopTracer } from '@opentelemetry/api/build/src/trace/NoopTracer';
import { FailureStrategySimple, SCProcessHandler, SuccessStrategySimple, Worker } from '@villedemontreal/workit-core';
const client = new ZeebeClient(config);
const successHandler = new SuccessStrategySimple();
const failureHandler = new FailureStrategySimple();
const processHandler = new SCProcessHandler(successHandler, failureHandler, new NoopTracer());
const worker = new Worker(client, processHandler);
worker.start();
worker.run();
Useful links
- Get started in 2 minutes.
- Documentation is available in this folder
- Comprehensive API documentation is available online and in the
docs
subdirectory
Maintainers
See the list of contributors who participated in this project.
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the MIT License - see the LICENSE file for details