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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@optimajet/workflow-designer

v20.0.3

Published

Designer for Workflow Engine

Readme

WorkflowEngine Designer

Introduction

WorkflowEngine Designer is a library developed to facilitate the use of this component. It provides a convenient way to interact and create the Workflow Designer on your web page.

Prerequisites

To run the example below, you should create the WorkflowEngine backend capable of handling requests from the Workflow Designer.

Installation

npm install @optimajet/workflow-designer

Basic Usage

import WorkflowDesigner from '@optimajet/workflow-designer'
//import '@optimajet/workflow-designer/localization/workflowdesigner.localization_ru'

const data = {
    schemecode: "<YOUR_SCHEME_CODE_VALUE>",
    processid: undefined
};

var wfdesigner = new WorkflowDesigner({
    apiurl: '<YOUR_API_URL_VALUE>',
    renderTo: 'root',
    graphwidth: window.innerWidth,
    graphheight: window.innerHeight,
});

if (wfdesigner.exists(data)) {
    wfdesigner.load(data);
} else {
    wfdesigner.create();
}

This code snippet is everything you need to initially display the Workflow Designer on your web page. Let's analyze it in more detail:

import WorkflowDesigner from '@optimajet/workflow-designer'
//import '@optimajet/workflow-designer/localization/workflowdesigner.localization_ru'

This section is responsible for importing the WorkflowDesigner constructor. By uncommenting line 2, you can localize the workflow designer. By default, the workflow designer has the English localization.

const data = {
    schemecode: "<YOUR_SCHEME_CODE_VALUE>",
    processid: undefined
};

var wfdesigner = new WorkflowDesigner({
    apiurl: '<YOUR_API_URL_VALUE>',
    renderTo: 'root',
    graphwidth: window.innerWidth,
    graphheight: window.innerHeight,
});

In this section:

  • schemecode - is the code for the Workflow diagram to be displayed in the Workflow Designer.

  • processid - is the identifier of the WorkflowEngine process.

  • the WorkflowDesigner constructor takes an object with the designer settings and creates a new instance of the WorkflowDesigner class. The example specifies all the necessary parameters of the designer, namely: the HTTP address of the WorkflowAPI for interacting with the back-end of the application (apiurl), the available width ( graphwidth) and height (graphheight) for displaying the WorkflowDesigner window, and the element ID, inside which the entire WorkflowDesigner interface is rendered (renderTo). For a more detailed list of the parameters, see the Designer section of the documentation page about the WorkflowEngine.

If you want to display the Workflow scheme in the Workflow Designer interface, set the required value to the schemecode variable, and assign the undefined value to the processid. In case you want to display the Workflow process, set the undefined value to the schemecode, and the required value to the processid variable of the WorkflowEngine process identifier.

if (wfdesigner.exists(data)) {
    wfdesigner.load(data);
} else {
    wfdesigner.create();
}

This section checks whether the above data exist and available for loading and displaying in the WorkflowDesigner. If the specified data exist, then they are loaded and rendered. Otherwise, a new empty Workflow diagram will be created.

Building and Running the Example

We use the webpack package to build our example.

npm i -D webpack webpack-cli

Next, add the packages necessary for the correct webpack setup

npm i -D @babel/preset-env @babel/core babel-loader css-loader html-webpack-plugin mini-css-extract-plugin terser-webpack-plugin

The basic webpack configuration looks like this:

const HtmlWebpackPlugin = require('html-webpack-plugin'); // for generate an HTML5 file
const path = require('path')
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); // to extract CSS into separate files
const TerserPlugin = require('terser-webpack-plugin'); // to minify your JavaScript
const webpack = require('webpack');


module.exports = () => ({
    entry: {
      wfesample: './src/index.js',
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: '[name].min.js',
        libraryTarget: "umd",
    },
    mode:'production',

    optimization: {
        minimizer: [new TerserPlugin()],
    },
    module: {
        rules: [
            {
              test: /\.css$/i,
              use: [MiniCssExtractPlugin.loader, "css-loader"],
            },
            {
              test: /\.m?js$/,
              exclude: /(node_modules|bower_components)/,
              use: {
                  loader: 'babel-loader',
                  options: {
                    presets: ['@babel/preset-env']
                  },
              },
          },
        ],
    },
    plugins: [
        new HtmlWebpackPlugin({ template: './src/index.html' }),
        new MiniCssExtractPlugin(),
        new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en/),
    ]
});

IE11 Support

To support successful performance of the designer in IE11, we should slightly modify the webpack configuration in webpack.config.js, but first we should add another package to transpile and modify our JavaScript.

npm i -D @babel/plugin-proposal-decorators

Now, add the target: ['web', 'es5'] property in the webpack config, and change the babel-loader rule inmodule.rules to the following:

//...
rules: [
    //...
    {
        test: /\.(js|jsx)$/,
        exclude: /@babel(?:\/|\\{1,2})runtime|core-js/,
        use: {
            loader: 'babel-loader',
            options: {
                babelrc: false,
                configFile: path.resolve(__dirname, 'babel.config.js'),
                compact: false,
                cacheDirectory: true,
                sourceMaps: false,
            },
        },
    },
],
//...

The only thing left to do is to create the babel.config.js file in the project root. The file should contain the following babel configuration:

module.exports = function (api) {
    api.cache(true);
    const presets = [
        [
            '@babel/preset-env',
            {
                corejs:"3",
                useBuiltIns: 'entry',
                targets: {
                    browsers: [
                        "edge >= 16",
                        "safari >= 9",
                        "firefox >= 57",
                        "ie >= 11",
                        "ios >= 9",
                        "chrome >= 49"
                    ]
                }
            }
        ]
    ];
    const plugins= [
        ["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }],
        ["@babel/plugin-proposal-class-properties", { "loose": true }],
        ["@babel/plugin-transform-spread"]
    ];
    return {
        presets,
        plugins
    }
}

The configuration is completed successfully, so you can enjoy using the WorkflowDesigner in IE11.

Hotkeys:

Ctrl + A - Select All Ctrl + C - Copy selected items Ctrl + E - New Activity Ctrl + I - Extended info Ctrl + Y - Redo Ctrl + Z - Undo Arrows - Moving selected items Delete - Delete Alt + Enter - Full Screen Mode Ctrl + M - Move mode