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

process-engine

v0.5.3

Published

Javascript Process Engine

Downloads

40

Readme

Process automation for Node.js

###Best For

  • Task Orchestration
  • Human Task Management
  • Process Management and Monitoring via a Node.js web application

###Features

  • Start/End/Decision/Parallel/Service/Human Task
  • Human Task Management
  • Process Definition Management and Visualization
  • Process Instance Management and Visualization

###Get Started npm install process-engine

var ProcessEngine = require('process-engine');
// Create a process engine object
var processEngine = ProcessEngine.create();
var simpleDefinition = {
  name: 'simple process',
  tasks: {
    start: {type: 'start'},
    'service1': {type: 'service', action: function (variables, complete) {
        console.log('do work');
        complete();
      }
    },
    end: {type: 'end'}
  },

  flows: [
    {from: 'start', to: 'service1'},
    {from: 'service1', to: 'end'}
  ]
};

// Create process instance from the above process definition
var processDefinition = processEngine.importProcessDefinition(simpleDefinition);
var processInstance = processEngine.createProcessInstance(processDefinition);
// Start the execution of the process instance
processInstance.start();

See examples/tests for all usage that process engine supports

###API

  • ProcessEngine
    • importProcessDefinition(definition): Create a new process definition based on definition object
    • createProcessDefinition(name): Create an empty process definition with name
    • loadProcessDefinition(id): Load a process definition by id
    • queryProcessDefinition(conditions, options): Query process definitions by conditions and options
    • createProcessInstance(def): Create a new process instance with definition def
    • loadProcessInstance(id): Load a process instance by id
    • queryProcessInstance(conditions): Query process instances by conditions
    • completeTask(processId, taskId, variables): Complete a task with processId, taskId, variables
  • ProcessInstance is a Node event emitter.
    • Events
      • before: emitted before each task is executed
      • after: emitted after each task is executed
      • end: emitted when the whole process instance is ended
    • start(variables): Start the process instance with given variables
    • getNode(taskName): Get the runtime node with taskName
  • HumanTaskService
    • complete(taskId, variables): Complete the human task taskId with variables
    • claim(taskId, user): Claim the human task taskId with User user
    • startWorking(taskId): Start to work on the human task taskId
    • query(conditions): Query the human tasks by conditions

###UI image

process-engine.js contains a Node.js web application to manage the process instances and human task list.

  • Go to ui folder
  • Run npm install
  • Run bower install
  • Run npm install -g nodemon
  • Run brunch watch --server to launch the server
  • Open http://localhost:3000/#/definitions in your browser

###Development

  • Test Runner: npm install -g mocha
  • Front End Package Manager: npm install -g bower
  • Front End Build: npm install -g brunch
  • Code Coverage: npm install -g istanbul

###Roadmap

  • Planned
    • Human Task Form Builder
    • User Management Service
    • Performance Benchmark
  • Future
    • Message/Timer Event Support
    • Separate Running and Histronic Process Instances into different collections
    • Sub Process
    • BPMN 2.0 XML Import/Export