@villedemontreal/workit-zeebe-client
TypeScript icon, indicating that this package has built-in type declarations

5.0.2 • Public • Published

WorkIt Zeebe Client

License: MIT

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

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

Package Sidebar

Install

npm i @villedemontreal/workit-zeebe-client

Weekly Downloads

0

Version

5.0.2

License

MIT

Unpacked Size

26.7 kB

Total Files

17

Last publish

Collaborators

  • electrotype
  • psionikangel
  • olivieralbertini
  • sdriton
  • joscelynjean
  • steph-lebl
  • livetocode