Coder Social home page Coder Social logo

camunda-community-hub / zeebe-simple-tasklist Goto Github PK

View Code? Open in Web Editor NEW
72.0 10.0 18.0 1.37 MB

Zeebe worker to manage manual/user tasks

License: Apache License 2.0

Java 71.95% CSS 0.38% JavaScript 6.85% HTML 20.82%
zeebe-worker zeebe user-task tasklist

zeebe-simple-tasklist's Introduction

Zeebe Simple Tasklist

License

Compatible with: Camunda Platform 8

Warning This community extension is deprecated. It doesn't support all the features of newer Camunda versions. You should prefer the official Camunda Tasklist that is available in Camunda SaaS and for self-managed. Further resources:

Thank you to all contributors for making it a great extension. 🎉

A Zeebe worker to manage user tasks in a workflow. It shows all jobs of the user task's type as a task/todo-list. A user can complete the tasks with requested data.

Note This community project is not related to the official Camunda Tasklist component in Camunda 8, nor the APIs. If you're looking for the Camunda Tasklist, check out the Camunda documentation.

Usage

Example BPMN with a user task:

<bpmn:userTask id="userTask" name="User Task">
 <bpmn:extensionElements>
   <zeebe:taskHeaders>
     <zeebe:header key="name" value="My User Task"/>
     <zeebe:header key="description" value="My first user task with a form field."/>
     <zeebe:header key="formFields" value="[{\" key\":\"orderId\", \"label\":\"Order Id\",
     \"type\":\"string\"}]" />
     <zeebe:assignmentDefinition assignee="demo" />
   </zeebe:taskHeaders>
 </bpmn:extensionElements>
</bpmn:userTask>
  • the worker is registered for jobs of type io.camunda.zeebe:userTask (the reserved job type of user tasks)
  • optional custom headers:
    • name - the name of the task (default: the element id)
    • description - a description what is the task about
    • taskForm (HTML) - the form to show and provide the task data (example task form)
    • formFields (JSON) - the form fields for the default task form, if no task form is set

Default Task Form

If no taskForm is defined then the default task form is used. It takes the formFields and renders a form with all defined fields. The fields are defined as JSON list, for example:

[{
    \"key\":\"orderId\", 
    \"label\":\"Order Id\", 
    \"type\":\"string\"
  }, {
    \"key\":\"price\", 
    \"label\":\"Price\", 
    \"type\":\"number\"
  }
]`)

The type must be one of: string, number, boolean.

Install

Docker

The docker image for the worker is published to GitHub Packages .

docker pull ghcr.io/camunda-community-hub/zeebe-simple-tasklist:latest
  • ensure that a Zeebe broker is running with a Hazelcast exporter (> = 1.0.0)
  • forward the Hazelcast port to the docker container (default: 5701)
  • configure the connection to the Zeebe broker by setting zeebe.client.broker.gateway-address ( default: localhost:26500)
  • configure the connection to Hazelcast by setting zeebe.client.worker.hazelcast.connection ( default: localhost:5701)

If the Zeebe broker runs on your local machine with the default configs then start the container with the following command:

docker run --network="host" ghcr.io/camunda-community-hub/zeebe-simple-tasklist:latest

For a local setup, the repository contains a docker-compose file. It starts a Zeebe broker with the Hazelcast exporter and the application.

cd docker
docker-compose --profile in-memory up

Go to http://localhost:8081

To use PostgreSQL instead of the in-memory database, use the profile postgres.

docker-compose --profile postgres up

Manual

  1. Download the latest application JAR ( zeebe-simple-tasklist-%{VERSION}.jar )

  2. Start the application java -jar zeebe-simple-tasklist-{VERSION}.jar

  3. Go to http://localhost:8081

  4. Login with demo/demo

Configuration

The worker is a Spring Boot application that uses the Spring Zeebe Starter. The configuration can be changed via environment variables or an application.yaml file. See also the following resources:

By default, the port is set to 8081, the admin user is created with demo/demo, and the database is only in-memory (i.e. not persistent).

zeebe:
  client:
    worker:
      defaultName: zeebe-simple-tasklist
      defaultType: user
      threads: 2
    
      hazelcast:
        connection: localhost:5701
        connectionTimeout: PT30S
    
      tasklist:
        defaultTaskForm: /templates/default-task-form.html
        adminUsername: demo
        adminPassword: demo

    job.timeout: 2592000000 # 30 days
    broker.contactPoint: 127.0.0.1:26500
    security.plaintext: true

spring:

  datasource:
    url: jdbc:h2:~/zeebe-tasklist
    user: sa
    password:
    driverClassName: org.h2.Driver

  jpa:
    database-platform: org.hibernate.dialect.H2Dialect
    hibernate:
      ddl-auto: update

server:
  port: 8081
  servlet:
    context-path: /  
  allowedOriginsUrls: ""

Change the Context-Path

The context-path or base-path of the application can be changed using the following property:

server:
  servlet:
    context-path: /tasklist/

It is then available under http://localhost:8081/tasklist.

Customize the Look & Feel

You can customize the look & feel of the Zeebe Simple Tasklist (aka. white-labeling). For example, to change the logo or alter the background color. The following configurations are available:

- white-label.logo.path=img/logo.png
- white-label.custom.title=Zeebe Simple Tasklist
- white-label.custom.css.path=css/custom.css
- white-label.custom.js.path=js/custom.js

Change the Database

For example, using PostgreSQL:

  • change the following database configuration settings
- spring.datasource.url=jdbc:postgresql://db:5432/postgres
- spring.datasource.username=postgres
- spring.datasource.password=zeebe
- spring.datasource.driverClassName=org.postgresql.Driver
- spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
  • the PostgreSQL database driver is already bundled

See the docker-compose file (profile: postgres) for a sample configuration with PostgreSQL.

Cross Origin Requests

To enable Simple Tasklist to send CORS header with every HTTP response, add the allowed origins (; separated) in the following property:

server:
  allowedOriginsUrls: http://localhost:8081;https://tasklist.cloud-provider.io:8081

This will then set Access-Control-Allow-Origin headers in every HTTP response.

Build from Source

Build with Maven

mvn clean install

Code of Conduct

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

License

Apache License, Version 2.0

About

screencast

zeebe-simple-tasklist's People

Contributors

actions-user avatar celanthe avatar chaima-mnsr avatar christian-konrad avatar dependabot-preview[bot] avatar dependabot[bot] avatar imgbotapp avatar menski avatar saig0 avatar schmetzyannick avatar sebastienmarchais avatar skayliu 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zeebe-simple-tasklist's Issues

How to set candidate group when a new user task is created?

Hi,

For each user task, I have predefined a list of candidate groups. The is to enforce that only the user belong to the candidate group can claim and complete the task.
How can I set the candidate group once the user task is created?

Unable to start with docker-compose due to connection refused

Hi, I'm trying to run this simple tasklist locally using the docker compose instructions and I get a connectivity error between the tasklist worker and zeebe broker.

Using the latest main branch, when I run this docker compose command
docker-compose --profile in-memory up

I get this error

zeebe-simple-tasklist-in-memory  | 2023-05-04 11:01:15.174  WARN 1 --- [ault-executor-2] io.camunda.zeebe.client.job.poller       : Failed to activate jobs for worker zeebe-simple-tasklist and job type io.camunda.zeebe:userTask
zeebe-simple-tasklist-in-memory  |
zeebe-simple-tasklist-in-memory  | io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
zeebe-simple-tasklist-in-memory  | 	at io.grpc.Status.asRuntimeException(Status.java:535) ~[grpc-api-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478) ~[grpc-stub-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:562) ~[grpc-core-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) ~[grpc-core-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:743) ~[grpc-core-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:722) ~[grpc-core-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) ~[grpc-core-1.45.1.jar:1.45.1]
zeebe-simple-tasklist-in-memory  | 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
zeebe-simple-tasklist-in-memory  | 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
zeebe-simple-tasklist-in-memory  | 	at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
zeebe-simple-tasklist-in-memory  | Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: zeebe/172.19.0.2:26500
zeebe-simple-tasklist-in-memory  | Caused by: java.net.ConnectException: Connection refused
zeebe-simple-tasklist-in-memory  | 	at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
zeebe-simple-tasklist-in-memory  | 	at java.base/sun.nio.ch.Net.pollConnectNow(Unknown Source) ~[na:na]
zeebe-simple-tasklist-in-memory  | 	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) ~[na:na]
zeebe-simple-tasklist-in-memory  | 	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:710) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
zeebe-simple-tasklist-in-memory  | 	at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

Note that the zeebe broker seems to have started up fine

...
zeebe_broker                     | 2023-05-04 11:00:09.727 [] [main] INFO
zeebe_broker                     |       org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
zeebe_broker                     | 2023-05-04 11:00:09.729 [] [main] INFO
zeebe_broker                     |       org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 13864 ms

Is anyone able to provide suggestions as to how to fix? I'm using the docker compose file from this repository https://github.com/camunda-community-hub/zeebe-simple-tasklist/blob/main/docker/docker-compose.yml

Perhaps I am missing some other setup that is required? Thanks very much

Change context-path not working as expected

Hi,

I am trying to have simple-takslist running on a different path then /
Therefore I have added:
- server.servlet.context-path=/tasklist
in the environment part of docker-compose.

It works, application is listening at /tasklist, but is giving the following layout:
image

So made more changes:

Changed the path’s in the the template files and mounted the changed template folder with docker-compose to /app/resources/templates. Changes that I made where e.g.
<form id="login-form" action="/tasklist/login" method="post">
in login.html

But also changes in header.html to add the right path.
that was already better, but adding a new user for example did not work, so I moved on to the .js files

changes to .js files, since creating user’s did not work anymore, so for example:
url: withSecurityToken('/tasklist/api/tasks/' + taskKey + '/claim'), url: withSecurityToken('/tasklist/api/users/'), url: withSecurityToken('/tasklist/api/users/' + username), in app.js and mounted to changes js folder to /app/resources/public/js

This resulted in a working app in /tasklist but only the login process did not work.

After login it does a wrong redirect (missing /tasklist prefix), if after login you change the path manually in the browser to the proper URL it works.

I suspect it is due to src/main/java/io/zeebe/tasklist/view/ViewController.java:
image

The RedirectView not respecting the path settings from server.servlet.context-path.

Thanks,

Maarten

A claimed task is visible for other users

Problem

When a task is claimed by user A then user B can see this task in its All Tasks list.

Solution

A task is not listed in All Tasks when another user is assigned to it.

Simple tasklist using custom postgreSql not working

I'm trying to run a simple tasklist using custom postgreql in docker compose with the following configuration:

Screenshot from 2022-09-15 18-01-53

but i get issue when i add user task to process. It looks like an error like this:

Screenshot from 2022-09-15 18-08-09

I've checked the db, the data has been inputted and nothing strange. I think there is a problem with the version db but for versions postgres:13.3-alpine and postgres:12.2 I get the same issue.

Everyone is there any suggestions for this case. Thankyou.

Docker image with postgres prebuilt

Hey,

When you want to use this awesome project with k8s and need PostgreSQL, it's extremely hard to achieve without a prebuilt docker image that already contains the PostgreSQL driver preconfigured.

Can you please add to your release?

Thanks,
Dan

Support Zeebe's user task forms

Since Zeebe 1.0.0, user tasks and task forms are supported: https://docs.camunda.io/docs/reference/bpmn-processes/user-tasks/user-tasks#user-task-forms

The task forms are a new part of the Camunda stack and can be modeled directly in the modeler: https://docs.camunda.io/docs/product-manuals/tasklist/userguide/camunda-forms

Replace the previous task forms and form fields with the official Camunda forms. The form viewer can be integrated as described here: https://github.com/bpmn-io/form-js/tree/master/packages/form-js-viewer

Can Postgres be used?

If I understand the architecture properly, the data exported through Hazelcast is saved in memory (the list of tasks). Meaning if the app restarts all the data is lost?

If so, can Postgres be used?

Emphasize more that this project is outdated

A user tried this project and was wondering that it uses job workers instead of the REST API.

With the intro of the Zeebe REST API for task management and job worker-based tasks becoming outdated, we should highlight that users should not use this project as a starting guide.

User and group management

  • I can log in as user
  • I can create new users
  • I can create new groups
  • I can assign a user to a group

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.