@mkostka/workit-zeebe-client
v4.2.3-alpha.8
Published
Zeebe client for WorkIt that works with Zeebe platform powered by TypeScript
Downloads
17
Maintainers
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 { NOOP_TRACER } from '@opentelemetry/api';
import { FailureStrategySimple, SCProcessHandler, SuccessStrategySimple, Worker } from 'workit-core';
const client = new ZeebeClient(config);
const successHandler = new SuccessStrategySimple();
const failureHandler = new FailureStrategySimple();
const processHandler = new SCProcessHandler(successHandler, failureHandler, NOOP_TRACER);
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