jbirddog / supreme-spoon

Repository from Github https://github.comjbirddog/supreme-spoonRepository from Github https://github.comjbirddog/supreme-spoon

Supreme Spoon

Supreme Spoon is a midlang frontend written in Python that produces binary executables for workflow specs generated by SpiffWorkflow. The supported environment for editing diagrams is Spiff Arena. At present very simple diagrams can be compiled and run, for some examples check out the CI Job.

Running

See the Makefile for the full source of truth. All development is done using the provided Dockerfile.

tl;dr - quick start:

Command Result
make Build the image then compile and run a sample process.
make dev-env Build the dev image and mlc support.
make start Build and run a sample process.
make tests Run the test suite.
make fmt Format the code.
make lint-fix Run the linter and try to auto fix when possible.
make compile-srt Build the srt library.
make sh Shell into the docker image.

Some variables can also be provided, for instance PROCESS_ID=no_tasks make start. For a full list check the Makefile.

Overall Design

Supreme Spoon is focused on compiling workflow specs to machine code. It leverages the mlc compiler via the midlang submodule to compile and link the executable. Part of forming the executable is providing a driver and runtime which is provided by a static library called srt. This library can be linked with the resulting workflow spec object files and provides functionality such as logging and receiving input for human tasks. The library can be replaced with other implementations that conform to the interface defined in runtime/runtime.h.

The spiffworkflow package

The spiffworkflow package takes a workflow spec json file and builds a task spec tree that it then uses to create midlang modules for the process and subprocess specs. There are lots of limitations and this package is being built out as needed. Currently supported:

  • Events
    • Start Events
    • End Events
    • Message Start Events
    • Timer Start Events
  • Subprocesses
    • Call Activities
    • Sub Worflows
  • Human Tasks
    • Manual Tasks
    • User Tasks
  • Tasks
    • Script Tasks
    • Service Tasks
    • Multi-instance Tasks
  • Gateways
    • Inclusive Gateways
    • Exclusive Gateways
    • Parallel Gateways
  • Data
    • Data Objects
    • Data Stores
  • Spiff Extensions
    • Pre-scripts
    • Post-scripts
  • ...

The lp Package

A very large part of SpiffWorkflow process models are scripts, be it from Script Tasks, Service Tasks, Pre-Scripts, Post-Scripts or Conditionals, etc. These scripts are expressed as Python code snippets and provide a lot of power to the BPMN author. The lp (Limited Python) is capable of taking a very small subset of Python and lowering it to midlang to facilitate compilation. There are lots of limitations and this package is being built out as needed. Currently supported:

  • Constants
    • bool
    • int
    • str
  • ...

About

License:GNU Lesser General Public License v2.1


Languages

Language:Python 91.4%Language:Makefile 8.2%Language:Dockerfile 0.3%