GithubHelp home page GithubHelp logo

bonitasoft / bonita-connector-slack Goto Github PK

View Code? Open in Web Editor NEW
0.0 13.0 1.0 122 KB

Enables interactions in your Bonita processes with Slack.

License: GNU General Public License v2.0

Kotlin 95.57% Groovy 4.43%
delivery-central lifecycle-independent published-full

bonita-connector-slack's Introduction

Bonita connector Slack

Build Release Maven Central License

This connector offers the possibility to send messages to a Slack channel.
To be used, a dedicated Slack application with write permissions must be installed on the target Slack organization.

The connector has four mandatory inputs:

  • OAuth Access Token: The OAuth access token of the installed slack application. See Your slack applications to find it.

  • Channel or Conversation ID: Defines in with channel / conversation the message is to be sent. To retrieve it, right click on the channel, copy the link of the channel and keep the last segment of the URL (something like CJC9BH4A9)

  • Notification: The text that appears on the notification received by users if they are notified. It is supposed to be a short summary of the message content.

  • Blocks: The real message to post on slack. More details in the section bellow.

The documentation of this SDK can be found here.
You can also use the block kit builder to get an idea of what is possible, but it doesn’t generate Java code.

⚠️

Bonita connector scripts are written with Groovy, thus the syntax to use the sdk differs a bit from the examples of the Slack documentation.

The input blocks expected by the connector is of type org.bonitasoft.connectors.model.SlackConnectorBlocks, an internal class that wraps a list of com.slack.api.model.block.LayoutBlock.

Here is an example of a script that build a message using the Slack SDK:

import org.bonitasoft.connectors.model.SlackConnectorBlocks

import com.slack.api.model.block.Blocks

import static com.slack.api.model.block.composition.BlockCompositions.plainText
import static com.slack.api.model.block.composition.BlockCompositions.markdownText

def header = Blocks.header{ it.text(plainText("Hello world!")) }
def divider = Blocks.divider()

def section = Blocks.section{
    it.text(markdownText("Hope your are having a wonderful day :smiley:")
}

return new SlackConnectorBlocks(header, divider, section)

To build this project, run the following command at the root of the project:

./mvnw clean package

To create a release:

  • Push a release commit on the main branch. This commit should update the pom version (remove -SNAPSHOT), and eventually the definition / implementation versions.

  • Start the Github action create release. You’ll have to define the release version, which should match the pom.xml version.

  • When the release is done, push a new commit on the next branch to prepare the next dev version (e.g 1.0.0 → 1.0.1-SNAPSHOT)

  • Do not forget to close and release the corresponding staging repository on sonartype.

bonita-connector-slack's People

Contributors

akantcheff avatar dependabot[bot] avatar rbioteau avatar

Watchers

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

Forkers

skoobeeb

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.