Git Product home page Git Product logo

node-red-contrib-zeebe's Introduction

node-red-contrib-zeebe

Compatible with: Camunda Platform 8

npm

This module leverages the zeebe-node client library to bring Zeebe awesomeness to Node-RED!

Please upgrade node-red-contrib-zeebe to v0.7+ for Zeebe v1.0 or current Camunda Platform 8 support! Zeebe versions prior to v1.0 are not supported anymore.

Learn more about how these nodes can be used from basic example flows.

worker / complete

task-worker and complete node

Creates a task worker and subscribes to specific tasks/jobs. The worker node outputs a Node-RED message for each newly received task/job. When a Node-RED message is received at the complete nodes's input, that task/job gets completed in Zeebe (with either success, failure or error).

Please note: These nodes only work in combination. Make sure, the complete object from the worker node output payload gets injected into the input of the complete node.

See example flow.

message

publish-message node

This node publishes a message to Zeebe, when a Node-RED message is received at the input.

The message must contain a name and a correlation key. Optionally you can pass in variables and configuration options like timeToLive.

See example flow.

start message

publish-start-message node

This node publishes a start message to Zeebe, when a Node-RED message is received at the input.

The message must contain a name, no correlation key needed. Optionally you can pass in variables and configuration options like timeToLive.

See example flow.

process

deploy node

Inject a bpmn process definition string to the input of this node to deploy it to Zeebe.

You can use the 'file in' node from Node-RED to read a bpmn file from disk, or get the process definition from anywhere you want.

See example flow.

process instance

workflow-instance node

A new process instance gets started in Zeebe, when a Node-RED message is received at the input.

Once the process instance has been created, the output sends a Node-RED message containing some meta-info, i.e. the processInstanceKey.

See example flow.

Developing

To test these nodes locally in node-red, the npm install <folder> command can be used. This allows you to develop the node in a local directory and have it linked into a local node-red install during development.

In your node-red user directory, typically ~/.node-red, run:

npm install <path to location of node-red-contrib-zeebe>

This creates the appropriate symbolic link to the directory so that Node-RED will discover the node when it starts. Any changes to the node’s file can be picked up by simply restarting Node-RED.

Tests

Tests are written in Jest, and live in the __tests__ directory. To run the unit tests:

npm test

Integration tests are in the __tests__/integration.js file.

They require a Zeebe broker to run. You can start a dockerised broker:

cd resources/travis/
docker-compose up

And then run them manually:

npm run test:integration

Contributions

Contributions are always welcome! There are some open issues.

node-red-contrib-zeebe's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar pedesen avatar xomiamoore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-red-contrib-zeebe's Issues

Example for the worker/complete node

Hi there,

I just tried to implement a zeebe worker over node-red:

  • added a worker node to my flow (listening to "echo" tasks)
  • connected the output to a debug node
  • connected the output to a complete node

The output of the debug node:

{"payload":{"job":{"key":"2251799813769806","type":"echo","workflowInstanceKey":"2251799813769794","bpmnProcessId":"ECHO","workflowDefinitionVersion":1,"workflowKey":"2251799813728423","elementId":"ServiceTask_0phglip","elementInstanceKey":"2251799813769803","customHeaders":{},"worker":"08adfae5-82b8-4e27-bd53-325282bc9958","retries":3,"deadline":"1569336118974","variables":{}},"complete":{}},"_msgid":"cbe132e.57828d"}

The complete node keep saying: "complete is not a function"

So I tried several tricks to set complete to a function but I'm failing. Can someone explain how to set complete to a function so the job is successfully completed in zeebe ? I just want to output variables at first.

Perhaps it can be helpful to document some examples in the README ?

Error start node-red on docker with node-red-contrib-zeebe

Dockerfile:
`FROM nodered/node-red

COPY package.json .
RUN npm install --only=production

COPY settings.js /data/settings.js
COPY flows.json /data/flows.json

CMD ["npm", "start"]`

docker-compose:
`version: "3.7"

services:
node-red:
container_name: node-red
build: .
environment:
- TZ=America/Sao_Paulo
ports:
- "1880:1880"
networks:
- operate_zeebe_network
external_links:
- zeebe:zeebe
volumes:
- node-red-data
volumes:
node-red-data:

networks:
operate_zeebe_network:
external: true`

package.json dependences:
"dependencies": { "node-red": "1.0.6", "node-red-contrib-zeebe": "0.6.3", "node-red-contrib-aws": "0.5.0", "node-red-dashboard": "~2.22.1" },

On exec 'docker-compose up --build'
Output:
node-red | 30 May 13:05:56 - [info] Node-RED version: v1.0.6 node-red | 30 May 13:05:56 - [info] Node.js version: v10.20.1 node-red | 30 May 13:05:56 - [info] Linux 4.14.177-107.254.amzn1.x86_64 x64 LE node-red | 30 May 13:05:56 - [info] Loading palette nodes node-red exited with code 0

Without node-red-contrib-zeebe, is successfull.

Tks,

Fix flaky integration tests

Problem

One of two integration tests fails from time to time, due to the 25 seconds jest timeout. Presumably one test is completing tasks of the other tests, if they're executed in parallel.

Proposal

Either make sure to use a different task type or run them sequentially.

Add docker-compose file for Node-RED, Zeebe, Operate

The docker-compose file should bootstrap a dockerized development environment containing a Node-RED instance, a single node Zeebe broker and Operate.

  • The Node-RED instance should come with pre-installed node-red-contrib-zeebe nodes pre-configured to point to the local Zeebe broker.

  • Everything should be documented

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.