Business Process eXecution Engine

Overview

BPXE (Business Process eXecution Engine)

Chat

BPMN 2.0 based business process execution engine implemented in Rust. BPMN stands for Business Process Model and Notation. BPMN's goal is to help stakeholders to have a shared understanding of processes.

BPXE focuses on the execution aspect of such notation, effectively allowing the processes described in BPMN to function as if they were programs. BPXE is not the only such engine, as there are many commercially or community supported ones. The motivation behind the creation of BPXE was to create an engine with a particular focus on type and memory safety, performance and multi-tenancy capabilities (ensuring that a great deal of processes should be able to operate even on a single server concurrently) and resistant to failures so that workflows can be resumed with little to no consideration when a failure happens.

Usage

Since BPXE is not a server in its own right, but rather a library, a good starting point would be to add this to your Cargo.toml:

[dependencies]
bpxe = "0.2.1"

You can also check out latest release API documentation, as well as bleeding edge master documentation.

Comments
  • Mock clock leaves lock taken

    Mock clock leaves lock taken

    This pattern repeats:

    https://github.com/bpxe/bpxe/blob/0828554a14ebbdc2c38b7564443c0036b0f05ab0/pkg/clock/mock.go#L53-L59

    	m.Lock()
    	ch := make(chan time.Time, 1)
    	if duration.Nanoseconds() <= 0 {
    		ch <- m.now
    		close(ch)
    		return ch
    	}
    

    This leaves the lock taken. Should use

    m.Lock()
    defer m.Unlock()
    
    code review 
    opened by tv42 4
  • Outsiders cannot set issue labels

    Outsiders cannot set issue labels

    https://github.com/bpxe/bpxe/blob/master/CODEREVIEWS.md#how-do-i-submit-reviews

    Simply open an issue and assign the code review label to it.

    Without extra access to the repository, people cannot do that.

    opened by tv42 3
  • Impossible clock logic

    Impossible clock logic

    https://github.com/bpxe/bpxe/blob/0828554a14ebbdc2c38b7564443c0036b0f05ab0/pkg/clock/host_generic.go#L28

    				if t1.Before(t1) {
    

    You can be pretty darn sure that t1 is never before itself.

    code review 
    opened by tv42 2
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

    opened by fossabot 1
  • Problem: passing instance information into traces

    Problem: passing instance information into traces

    Problem: passing instance information into traces

    Currently, traces produced by many components don't point to particular process instances they are produced in. This will make results of future analysis or querying of such information ambiguous.

    Solution: allow traces to be wrapped and unwrapped

    This change introduces the concept of trace wrapping (primarily through the newly introduced WrappedTrace interface and unwrapping (though WrappedTrace.Unwrap() and tracing.Unwrap() functions).

    Tracers can be contextualized by creating a new tracer that will transform produced traces (see tracing.NewTraceTransformingTracer) and passing it to components in a given context.

    Also, there's another problem that have been observed during the development of this feature:

    Problem: process instance observing traces from outside

    Currently, there's no reason for process instance components to observe traces from outside of its own scope; in fact, it'll likely mistreat traces from other instances or other processes as its own.

    Solution: compartmentalize tracers

    This way, instance gets its own tracer and its tracer are relayed to process's tracer and so on. This removes transforming tracer as it is no longer necessary. Instead, tracer relay does its job.

    I am still not 100% confident this is the right approach but it is better than leaving things as they are with scopes bleeding into other scopes. I am trying to think if there's any reason for observing traces outside of tracing compartment. If there will be such a need, we'll need to wire it through accordingly.

    opened by yrashk 0
  • Finish adding @fire-bot to your repo

    Finish adding @fire-bot to your repo

    Greetings, fire here!

    @yrashk recently invited @fire-bot to this repository. Before fire is enabled, @yrashk needs to complete a few steps:

    Complete fire setup now

    Only @yrashk will be able to enable fire using the above link. If someone added fire by mistake, feel free to remove @fire-bot from your repo's collaborators.

    opened by fire-bot 0
  • Problem: tracking mutex unlocking patterns

    Problem: tracking mutex unlocking patterns

    Some of the code has branching with its own unlocking of mutexes. This code is error-prone as it's easy to forget to unlock.

    Solution: use deferred unlocks where feasible

    Previous implementation was based on a now-outdated knowledge that deferrals are slower. As it was pointed out in #68, this is no longer true as of Go 1.14. My own measurements seem to confirm this as well.

    So, where it was reasonable, I've rewritten unlocking to happen in deferred statements.

    opened by yrashk 0
  • Problem: bad advice on testing clock changes

    Problem: bad advice on testing clock changes

    It suggests to change time within a docker container, but it'll actually change system time, because we give that capability to the container.

    Solution: rewrite the advice to use a virtual machine and provide a Vagrant setup for that, as well as instructions.

    opened by yrashk 0
  • Problem: `clock.Mock.After` doesn't unlock

    Problem: `clock.Mock.After` doesn't unlock

    When After takes the fast path of returning when the duration is zero or negative, it doesn't unlock its mutex.

    Solution: unlock it (just like Until does)

    Addresses #68

    opened by yrashk 0
  • Problem: impossible clock logic in host's change monitor

    Problem: impossible clock logic in host's change monitor

    There's a test that tests whether a certain time is before itself. That's clearly impossible.

    Solution: check whether it's before previously known time

    While we're at it, update current time on every iteration of the loop.

    The reason for this mishap is that this piece of code is not well tested yet (since it can be only tested manually)

    Addresses #64

    opened by yrashk 0
  • Problem: timer tests fail sporadically

    Problem: timer tests fail sporadically

    The error seems to indicate that something is being received from the channel when it's not expected to.

    Solution: handle channel closure

    Since timers close channels when it is safe to do so, sometimes tests receive another (zero) message that indicates channel closure.

    This change handles this behavior by observing optional flag that indicates whether the channel is closed.

    opened by yrashk 0
  • Proposal: split server and library, means provide flexibility in usage

    Proposal: split server and library, means provide flexibility in usage

    Hi,

    I really appreciate your work in building such a BPMN engine in Go. I'm quite impressed by your problem statement because it's exactly my thinking. Really great job done 👍

    One sentence caught my attention - the usage one: "BPXE does not have an executable server of its own and can be only used as a Go library." Frankly said that's exactly, what I'm looking for, an engine as a library.

    Let me explain, why I think splitting BPXE into lib and server as separate projects would be a better idea. Every point you mentioned about business is interested in transparency and wants to know what is implemented is right. So the benefits of BPMN having a modeler and thus some "live documentation" is great. On the other hand, when you want to deploy a (or any) workflow engine into a server, you're faced with questions about partitioning, consistency, availability (CAP theorem). What I mean: as the author of this project, you would need to support the most common database, fiddle with their quirks, ensure multiple server instances can run (high availability), and make this overall very responsive. That's a lot of work, which not everyone needs.

    Think for a moment, bpxe would have no DB persistency implemented and just allows other developers to load BPMN files, and execute them in memory only - period. This would lower the barrier to include such a lib instead of developing homebrew state machines or what-not, with having full documentation and modeling support available.

    That said, the bpxe engine would be focused on being a lib without DB support, one would certainly need two handfuls of callbacks/hooks so that application developers can react to state changes of the BPMN process state. They would follow their existing paradigms of putting the state into the DB with their preferred DB technology.

    Bare with me, when I share this example from the Javascript space ... https://github.com/paed01/bpmn-engine/blob/HEAD/docs/Examples.md This engine is built as lib only.

    Considering the lib offering such interfaces, you're not blocked and still be able to develop another project, which then would/could focus on being a server incl. database support, UI etc.

    I hope my thought is not offending, because I really love Open Source and collaboration around it. And I would be very glad to get some reflections from you and this idea.

    Sincerely Martin

    opened by nitram509 0
  • Type aliases as used here don't provide value, type safety

    Type aliases as used here don't provide value, type safety

    https://github.com/bpxe/bpxe/blob/0828554a14ebbdc2c38b7564443c0036b0f05ab0/pkg/bpmn/schema.go#L19-L29

    type QName = string
    type Id = string
    

    This lets callers intermingle the types freely, removing any benefit of using the types. Should use

    type QName string
    type Id string
    

    and so on.

    https://play.golang.org/p/k8vgBkqdmwr

    package main
    
    import (
    	"fmt"
    )
    
    type Foo = string
    type Bar = string
    
    func demo(b Bar) {
    	fmt.Printf("i'm happy to have receiver a bar: %v\n", b)
    }
    
    func main() {
    	var f Foo = "i'm a foo"
    	demo(f)
    }
    

    Also, ID not Id: https://github.com/golang/go/wiki/CodeReviewComments#initialisms

    code review 
    opened by tv42 2
  • Problem: testing different cases

    Problem: testing different cases

    Currently, testing BPXE against different cases / BPMN documents is a bit verbose, and it's sometimes hard to debug.

    Proposed solution (1): extract more primitives to simplify testing

    Proposed solution (2): externalize testing by creating a common tracing format as well as live querying / event injection.

    This is a larger undertaking than (1) but it has the following benefits:

    1. [Live] trace querying is one of the most important features BPXE will provide, so it needs to be done anyway
    2. It will allow to test any BPMN engine that can produce the same tracing format.

    I think proposed solutions (1) and (2) aren't exactly mutually exclusive.

    opened by yrashk 0
  • Problem: can't instantiate process using Receive Task

    Problem: can't instantiate process using Receive Task

    As mentioned in 460473db4420e2c14185afe65dcba3f8a8e2a1a6, one can't instantiate a process using a Receive Task, simply because Receive Task hasn't been implemented.

    std-coverage 
    opened by yrashk 0
  • Problem: can't instantiate process via event-based gateway

    Problem: can't instantiate process via event-based gateway

    As mentioned in 460473db4420e2c14185afe65dcba3f8a8e2a1a6, one can't instantiate a process using an Event-Based Gateway, simply because it's not a handled use case yet.

    std-coverage 
    opened by yrashk 0
  • Problem: event-based gateway testing

    Problem: event-based gateway testing

    Currently (as of 0154b48a964c93f02947029be367730974cea4f1) https://github.com/bpxe/bpxe/blob/0154b48a964c93f02947029be367730974cea4f1/pkg/flow_node/gateway/event_based_gateway/tests/event_based_gateway_test.go#L18-L25 only tests event-based gateway that it'll follow a certain path in presence of just one event, but it doesn't test what will happen if both events will occur.

    Proposed solution: figure out how to improve the test to support this case

    Naive implementation like this one below blocks somewhere:

    testEventBasedGateway(t, func(reached map[string]int) {
        assert.True(t, reached["task1"] == 1 || reached["task2"] == 1)
        assert.Equal(t, 1, reached["end"])
    }, event.NewMessageEvent("Msg1", nil), event.NewSignalEvent("Sig1"))
    

    Not yet sure if this is due to how the test function works or due to a bug in the implementation.

    test-coverage 
    opened by yrashk 0
Owner
BPXE
Business Process eXecution Engine
BPXE
A tutorial of building an LSM-Tree storage engine in a week! (WIP)

LSM in a Week Build a simple key-value storage engine in a week! Tutorial The tutorial is available at https://skyzh.github.io/mini-lsm. You can use t

Alex Chi 870 Jan 3, 2023
The simplest way to de-Google your life and business: Inbox, Calendar, Files, Contacts & much more

Bloom The all-in-one private workspace Try it for free! You no longer trust tech monopolies with your data? You are done with your privacy invaded by

Sylvain Kerkour 1.6k Dec 26, 2022
Blockchain Business Card v2

This is NEAR chain dApp consisting a relatively simple smart contract written in rust and implemented with a react front end. The contract allows you to mint a business card for 5 NEAR.

Julio Ramirez 5 Feb 8, 2022
Cost saving K8s controller to scale down and up of resources during non-business hours

Kube-Saver Motivation Scale down cluster nodes by scaling down Deployments, StatefulSet, CronJob, Hpa during non-business hours and save $$, but if yo

Mahesh Rayas 5 Aug 15, 2022
Automate your business flows, support, change tickets with Automatdeck

Automatdeck agent Website: https://automatdeck.com Documentation: https://doc.automatdeck.com Automatdeck agent is a simple lightweight IT automation

Kheshav Sewnundun 5 Aug 2, 2022
symbolic execution engine for Rust

Seer: Symbolic Execution Engine for Rust Seer is a fork of miri that adds support for symbolic execution, using z3 as a solver backend. Given a progra

David Renshaw 313 Dec 26, 2022
Symbolic execution of LLVM IR with an engine written in Rust

haybale: Symbolic execution of LLVM IR, written in Rust haybale is a general-purpose symbolic execution engine written in Rust. It operates on LLVM IR

UCSD PLSysSec 404 Jan 1, 2023
Utilities for creating strictly ordered execution graphs of systems for the Bevy game engine

bevy_system_graph This crate provides the utilities for creating strictly ordered execution graphs of systems for the Bevy game engine. Bevy Version S

Hourai Teahouse 19 Dec 2, 2022
Yet another code execution engine written in Rust.

exec Yet another blazingly fast code execution engine written in Rust. Paths GET /api/v1/status GET /api/v1/runtimes POST /api/v1/execute POST /api/v1

Stefan Asandei 2 Jul 11, 2023
secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process.

secmem-proc is a crate designed to harden a process against low-privileged attackers running on the same system trying to obtain secret memory contents of the current process. More specifically, the crate disables core dumps and tries to disable tracing on unix-like OSes.

null 3 Dec 19, 2022
Structure-aware, in-process, coverage-guided, evolutionary fuzzing engine for Rust functions.

fuzzcheck Fuzzcheck is a structure-aware, in-process, coverage-guided, evolutionary fuzzing engine for Rust functions. Given a function test: (T) -> b

Loïc Lecrenier 394 Dec 20, 2022
Performs distributed command execution, written in Rust w/ Tokio

Concurr: Distributed and Concurrent Command Execution, in Rust This project is dual licensed under MIT and Apache 2.0. Originally inspired by the GNU

Michael Murphy 93 Dec 18, 2022
Execution of and interaction with external processes and pipelines

subprocess The subprocess library provides facilities for execution of and interaction with external processes and pipelines, inspired by Python's sub

Hrvoje Nikšić 375 Jan 2, 2023
Secure sandboxing system for untrusted code execution

Godbox Secure sandboxing system for untrusted code execution. It uses isolate which uses specific functionnalities of the Linux kernel, thus godbox no

Nathanael Demacon 19 Dec 14, 2022
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

Zeke Medley 7 Oct 3, 2022
Measure the execution time of an application

Execution Timer Drag an executable file on the binary or enter the path as an argument to measure the execution time of the program. Building cargo bu

Flux Industries 2 Nov 16, 2021
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

zeke 7 Oct 3, 2022
A discord bot that safely executes whatever rust you throw at it. Remote code execution as a service

RustBot Bot is still under development and not ready for production use RustBot is a discord bot that executes whatever rust code you throw at it. In

Conner Bradley 7 Jan 3, 2022
Rate limit guard - Lazy rate limit semaphore implementation to control your asynchronous code frequency execution

Lazy rate limit semaphore (a.k.a fixed window algorithm without queueing) implementation to control your asynchronous code frequency execution

Yan Kurbatov 4 Aug 1, 2022
L2 validity rollup combined with blind signatures over elliptic curves inside zkSNARK, to provide offchain anonymous voting with onchain binding execution on Ethereum

blind-ovote Blind-OVOTE is a L2 voting solution which combines the validity rollup ideas with blind signatures over elliptic curves inside zkSNARK, to

Aragon ZK Research 3 Nov 18, 2022