Code Monkey home page Code Monkey logo

gaia-js-sdk-convey's Introduction

DEPRECATED! -> Migrated to https://github.com/leftshiftone/conveyjs

Convey

CircleCI branch GitHub tag (latest SemVer)

Convey is a JavaScript Framework for connecting to processes created with G.A.I.A..

The framework ist compatible with all major Browsers and can be used standalone as well as in conjunction with React, Angular or Vue.

Integration

In order to add Convey to your project, follow these steps:

Prerequisites

In order to integrate with G.A.I.A. two things are required:

  1. MQTT endpoint: e.g. wss://gaia.local/mqtt
  2. Identifier of the so called Identity to connect to.

Add Convey

npm i gaia-js-sdk-convey

Create HTML page

<html>
    <head>
        <meta charset="UTF-8"/>
        <link rel="stylesheet" href="gaia-js-sdk-convey-std.css"/>
        <script src="gaia-js-sdk-convey-std.js"></script>
    </head>
    <body>
        <div class="lto-gaia">
            <div class="lto-content"></div>
                <div class="lto-suggest"></div>
                <input class="lto-textbox"/>
                <button class="lto-invoker"/>
            </div>
        </div>
    </body>
</html>

Integrate Convey as standalone lib

Add the following before the </head> tag in the HTML file.

<script type="javascript">
    new GaiaConvey.Gaia(
        new GaiaConvey.ContentCentricRenderer(),
        new GaiaConvey.OffSwitchListener()
    ).connect('wss://DOMAIN_NAME/mqtt', 'IDENTITY_ID')
        .then(connection => {
            connection.subscribe(ChannelType.CONTEXT, (data) => console.log(data));
            connection.reception();
        });
</script>

Integrate Convey as NPM package

import {Gaia, ContentCentricRenderer, OffSwitchListener, ChannelType} from "gaia-js-sdk-convey";
...
new Gaia(new ContentCentricRenderer(), new OffSwitchListener())
    .connect('wss://DOMAIN_NAME/mqtt', 'IDENTITY_ID')
    .then(conn => {
        conn.subscribe(ChannelType.CONTEXT, (data) => console.log(data));
        conn.reception();
    });

Channels

The communication with G.A.I.A. contains several channels where each one has its own purpose.

TEXT

Is the main channel and is responsible for exchanging the elements configured in G.A.I.A.. Convey automatically subscribes to this channel. The messages in this channel are rendered to HTML elements.

NOTIFICATION

Each notification configured in the G.A.I.A. BPMN process can be received if subscribed to this channel.

LOG

G.A.I.A. sends logs for certain process executions which can be received by subscribing to this channel.

Renderer

A Renderer defines how elements, arrived in the TEXT channel, are rendered in the HTML DOM tree. Furthermore, a renderer allows for specifying the layout of an integration project.

Classic Renderer

The classic renderer renders the G.A.I.A. messages in a classic top-down manner.

Content Centric Renderer

The content centric renderer tries to maximize the time a content is visible by updating the content if possible or displaying interrupting actions like intent cascading by overlaying the content.

RevealJS Renderer

Renderer implementation which is based on the reveal.js library. This renderer supports horizontal as well as vertical navigation.

NoopRenderer

No-operation dummy renderer. Mainly used for audio only use cases.

Listener

A listener provides the functionality to react to certain events. Events can be

  • Connected
  • ConnectionLost
  • PacketSend
  • Disconnected
  • Error
  • Message

Default Listener

Acts as the base listener.

OffSwitch Listener

If an input text area should only be visible when a input is required, this is the listener to be used.

Modules

The following modules are available:

  • std: Contains default modules
  • aud: Contains the audio module
  • cod: Contains the code reader module (e.g. QRCode)
  • map: Contains modules for Open Street Map and Google Maps
  • vis: Contains modules for rendering data as charts
  • all: Contains all modules

Development

Release

Releases are triggered locally. Just a tag will be pushed to trigger the CI release pipeline.

Major

Run yarn trigger-release:major locally.

Minor

Run yarn trigger-release:minor locally.

Patch

Run yarn trigger-release:patch locally.

gaia-js-sdk-convey's People

Contributors

aemaem avatar c7nw3r avatar daniel-schwab-bearingpoint avatar dependabot[bot] avatar fridayy avatar lexermal avatar malleran avatar manuel382 avatar ptrcc avatar rschluesselbauer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

metrophos

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.