npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@brixx/process-script

v1.2.1

Published

A free JavaScript brixx process script library for Web and Node.js Applications with full integration into HTML without coding.

Downloads

264

Readme

Brixx-Process-Script

Process Driven Development for everyone

Brixx-Process-Script is a free JavaScript library to create process applications for the Brixx-Process-Engine and fill in a gap to enterprise process orchestration systems such as Camunda or X4 BPMS as a lean workflow management system for automation and digitization of business processes and industrial processes. For processes in web applications, to control multiple web applications up to IoT control. With minimal development, integration and costs, Brixx Process Engine can serve as the basis for applications or be integrated into existing applications as an extension for sub-processes. With our Brixx-Process-Script, the programming can be reduced to a minimum. Fast integration into any HTML document is possible, especially with the integrated Brixx-Script (smart web components) as Brixx HTML elements or as Brixx script components in JavaScript applications and frameworks and also support JavaScript environments such as Node.js® (cross-platform JavaScript runtime environment).

Model processes and workflows

With our workflow management system, all types of processes and workflows can be mapped with the Brixx BPMN-Editor for process modeling with Business Process Model and Notation (BPMN) and made available in the Brixx Process Engine with one click.

Installation

You can install the package with npm.

npm i @brixx/process-script

Import

You can import the package as module.

import { BrixxProcessDefinition } from '@bprocess-script'

Usage

Web

HTML based

Brixx web component in the Brixx script component file brixx-login-process.js

// Get search param
const pid = BrixxProcessDefinition.getSearchParam("pid");

// Message task action callback function
const addMessageElement = (data, message = `${data.mid} is running.`) => {
    const { tid } = data;
    const element = (
        <div>
            <h2>{message}</h2>
            <p />
            <input type="button" id={"btn_" + tid} value={"Next"} />
        </div>
    );
    new Brixx().render({ element });
    document.getElementById("btn_" + tid).addEventListener("click", () => {
        // Set process done
        BrixxProcessDefinition.process.done({ tid });
    });
};

// Login task action callback function
const addLoginElement = (data) => {
    const { tid } = data;
    const element = (
        <div>
            <h2>Authentication</h2>
            <p>
                User: <input type="text" id={"user"} />
            </p>
            <p>
                Password: <input type="text" id={"password"} />
            </p>
            <input type="button" id={"btn_login"} value={"Login"} />
        </div>
    );
    new Brixx().render({ element });
    document.getElementById("btn_login").addEventListener("click", () => {
        // Set next process with store data
        const store = { user: document.getElementById("user").value, password: document.getElementById("password").value };
        BrixxProcessDefinition.process.task.next({ tid, store });
    });
};

// Brixx process definition
Brixx.element = (
    <ProcessDefinition mid="Process_nehz6cn" pid={pid}>
        <Task mid="Task_0r94slz" action={(data) => addLoginElement(data)}>
            <Gateway mid="Gateway_0r8twz8" action={(data) => BrixxProcessDefinition.process.done({ gid: data.gid }) } >
                <Task mid="Task_1m8u5ed" action={(data) => addMessageElement( data, "You have entered the user area.") } />
                <Task mid="Task_0zs24yh" action={(data) => addMessageElement( data, "You have entered the public area.") } />
            </Gateway>
        </Task>
    </ProcessDefinition>
);

// Register a Brixx HTML-Element <brixx-login-process>
Brixx.registerElement({ name: "login-process" });

Brixx HTML element in the HTML file index.html

<!DOCTYPE html>
<html>
    <head>
        <!-- Load Brixx-Process-Script standalone for development-->
        <script src="https://brixx.it/@brixx/standalone/brixx-process.min.js"></script>
        <!-- Include the Brixx script component files for development -->
        <script type="text/babel" src="./brixx-login-process.js"data-type="module" data-presets="brixx"></script>
    </head>

    <body>
        <!-- Add the Brixx HTML element -->
        <brixx-login-process></brixx-login-process>
    </body>
</html>

JavaScript based

Brixx JavaScript element in the HTML file index.html

<!DOCTYPE html>
<html>
    <head>
        <!-- Load Brixx-Process-Script standalone for development-->
        <script src="https://brixx.it/@brixx/standalone/brixx-process.min.js"></script>
    </head>

    <body>
        <h1>Brixx Process Script Sample</h1>

        <script type="text/babel" data-presets="brixx">
            // Get search param
            const pid = BrixxProcessDefinition.getSearchParam('pid')

            // Message task action callback function
            const addMessageElement = (data, message = `${data.mid} is running.`) => {
                const { tid } = data;
                const element = (
                    <div>
                        <h2>{message}</h2>
                        <p />
                        <input type="button" id={"btn_" + tid} value={"Next"} />
                    </div>
                );
                new Brixx().render({ element });
                document.getElementById("btn_" + tid).addEventListener("click", () => {
                    // Set process done
                    BrixxProcessDefinition.process.done({ tid });
                });
            };

            // Login task action callback function
            const addLoginElement = (data) => {
                const { tid } = data;
                const element = (
                    <div>
                        <h2>Authentication</h2>
                        <p>
                            User: <input type="text" id={"user"} />
                        </p>
                        <p>
                            Password: <input type="text" id={"password"} />
                        </p>
                        <input type="button" id={"btn_login"} value={"Login"} />
                    </div>
                );
                new Brixx().render({ element });
                document.getElementById("btn_login").addEventListener("click", () => {
                    // Set next process with store data
                    const store = { user: document.getElementById("user").value, password: document.getElementById("password").value };
                    BrixxProcessDefinition.process.task.next({ tid, store });
                });
            };

            // Set process definition iterator
            BrixxProcessDefinition.process.iterator = (data) => {
                switch (data.mid) {
                case 'Gateway_0r8twz8':
                    BrixxProcessDefinition.process.done({ gid: data.gid })
                    break
                case 'Task_0r94slz':
                    addLoginElement(data)
                    break
                case 'Task_1m8u5ed':
                    addMessageElement(data, 'You have entered the user area.')
                    break
                case 'Task_0zs24yh':
                    addMessageElement(data)
                    break
                }
            }

            // Start process definition
            BrixxProcessDefinition.process.start({ pid })
        </script>
    </body>
</html>

Node.js (preview)

Install the Brixx-Process-Script package e.g. in a Visual Studio Code terminal window (see documentation below).

> npm i @brixx/process-script

Node.js app in the JavaScript file ./brixx-login-process.js

// Imports
const BrixxProcessDefinition = require("@brixx/process-script/node").default;

// Get command-line argument
const pid = process.argv[2]

// Set process definition iterator
BrixxProcessDefinition.process.iterator = (data) => {
    switch (data.mid) {
    case 'Gateway_0r8twz8':
        // Your code ...
        // BrixxProcessDefinition.process.done({ gid: data.gid })
        break
    case 'Task_0r94slz':
        // Your code ...
        // BrixxProcessDefinition.process.done({ tid: data.tid })
        break
    case 'Task_1m8u5ed':
        // Your code ...
        // BrixxProcessDefinition.process.done({ tid: data.tid })
        break
    case 'Task_0zs24yh':
        // Your code ...
        // BrixxProcessDefinition.process.done({ tid: data.tid })
        break
    }
};

// Start process definition
BrixxProcessDefinition.process.start({ pid });

Start Brixx process application in terminal

> node brixx-login-process.js {pid}

Documentation

See BRIXX.it documentation repository