A BPMN.js extension to improve working with SpiffWorkflow - the python BPMN engine.
Go to file
Kevin Burnett ee86b31cd7
Feature/spiff message branch (#100)
* Add new props from editor

* Fix receive message

* Handle no messages found

* remove debounce

* Spiff message : Custom MultiSelect Input

* Add event for open json schema editor

* Get Schemas Ids - Mock API

* Implement MessageJsonSchemaSelect

* Lint

* Refactoring

* Add some missing dependencies

* Branch Refactoring

* Fix broken tests

clear extensions element on change message selected

Fix Send Task

Add Is Matching Correlation enabled

Add Variable condition

Move variable

Move Payload

List correlation props based on element

AddMatching condition Array

Branch Refactoring

* Adding spiffworkflow namespace

* Handle message APIs

* hooking message button to post and listen to the event bus.

* Fix Message Editor Button Labeling

* load files with jsx as jsx w/ burnettk

* updates to work with vite in the frontend w/ burnettk

* Add Correlation Key

* fix automatic deletion of messages&&correlationProps

* Hide message on process level

* Sync Messages and correlations on DeleteEvent

* Fix deletion of correlation properties

* Message Payload issue

* Fix payload for message events

* Fix matching condition

* fix matching condition - css issue

* Fire add new message event

* Fix AddMessage event

* Fix AddMessage event

* Fix/message tests - duplicated correlations keys (#99)

* Append correlation Properties in Launch editor event

* Not allow two parent correlation keys

* Fix Message tests #1

* fix broken tests

* Add unit test for add message event

* some updates while reviewing w/ burnettk

---------

Co-authored-by: jasquat <jasquat@users.noreply.github.com>

---------

Co-authored-by: Ayoub Ait Lachgar <44379029+theaubmov@users.noreply.github.com>
Co-authored-by: Ayoub ait lachgar <ayoubaitlachgar98@gmail.com>
Co-authored-by: Dan Funk <daniel.h.funk@gmail.com>
Co-authored-by: jasquat <jasquat@users.noreply.github.com>
2024-06-10 12:00:11 -04:00
.github Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#88) 2024-04-25 09:23:35 -07:00
app Feature/spiff message branch (#100) 2024-06-10 12:00:11 -04:00
docs update readme with pretty picture 2022-06-07 15:15:32 -04:00
resources Ability to add and delete data objects (not just data object references) 2022-07-06 13:25:53 -04:00
test Feature/spiff message branch (#100) 2024-06-10 12:00:11 -04:00
.eslintrc.js dedup eslint config 2022-10-01 00:09:57 -04:00
.gitignore Revert "clean up git." 2022-09-23 14:28:56 -04:00
.prettierrc.js added some linting stuff for vim autocorrect 2022-08-05 09:35:26 -04:00
.tool-versions added tool-versions for node 18.3.0 which seems to be working w/ burnettk 2022-07-12 16:32:27 -04:00
LICENSE consistent license 2024-02-05 15:26:59 -05:00
README.md consistent license 2024-02-05 15:26:59 -05:00
RELEASE_PROCESS.md Documenting the release process 2022-06-09 13:18:49 -04:00
karma.conf.js Vite support (#85) 2024-04-15 14:39:39 -04:00
package-lock.json Feature/spiff message branch (#100) 2024-06-10 12:00:11 -04:00
package.json Feature/spiff message branch (#100) 2024-06-10 12:00:11 -04:00
webpack.config.js Fix React Modules (#86) 2024-04-18 18:39:58 -07:00

README.md

Tests

SpiffWorkflow Extensions for BPMN.js

This package provides extensions that can be applied to BPMN.js that will enable some important features of SpiffWorkflow - the Python BPMN Library for executing business processes. See below for more information.

IMPORTANT: This is a work in progress, and is not yet released.

About

This extension creates a BPMN editor with all the capabilities of BPMN.js and the following additions / modifications:

  • Ability to insert BPMN's Data Input and Data Output Objects.
  • A SpiffWorkflow centric Properties Panel for specifying scripts to run before and after a task, and for defining documentation, and Mark-up content for displaying in user and manual tasks. Among other things.

Data Input and Data Output Element

This extension will allow you to drag BPMN Data Input and Data Output elements onto the diagram and give them appropriate labels. This will generate valid BPMN elements in the underlying XML file - connecting them to the IO Specification of the process, as shown below:

  <bpmn:process id="my_delightful_process" isExecutable="true">
    <bpmn:ioSpecification>
      <bpmn:dataInput id="DataInput-745019423-1" name="num_dogs" />
      <bpmn:dataOutput id="DataOutput-711207596-1" name="happy_index" />
    </bpmn:ioSpecification>
    ...

Screenshot

Using these data input and outputs will allow you to create processes designed to be used as Call Activities. SpiffWorkflow (in a soon-to-be released version) will pick up this information, and enforce it. So that you must provide these input variables to execute, and only the variables mentioned in the output will be passed back to the calling process.

Usage

import BpmnModeler from 'bpmn-js/lib/Modeler';
import spiffworkflow from 'bpmn-js-spiffworkflow/app/spiffworkflow';


var bpmnJS = new BpmnModeler({
  additionalModules: [
    spiffworkflow
  ],
  moddleExtensions: {
    spiffworkflowModdle: spiffModdleExtension
  }
});

Run the Example

You need a NodeJS development stack with npm installed to build the project.

To install all project dependencies execute

npm install

To start the example execute

npm start

To build the example into the public folder execute

npm run all

Integration Points

You can use the EventBus to communicate with this UI, sending and receiving messages to change the behavior of the editor making it easier for your end users. There are many examples of this in the app.js file.
Below is a table of all the events that are sent and accepted:

Event Name Description Fired or Acceped Parameters Description
spiff.service_tasks.requested Request a list of available services for service task. Fired -
spiff.service_tasks.returned Provides a list of services. Recieved serviceTaskOperators ex: [{id:'Chuck Facts', parameters[{id:'category', type:'string'}]}]
spiff.script.edit Request to edit a python script in some sort of facy editor. Fired scriptType one of: script, preScript, postScript
value The actual python script
element The element that needs updating
eventBus Used by receiver to fire back an event
spiff.script.update Update a python script to a new value. Recieved scriptType one of: script, preScript, postScript
value The updated script
element The element that needs updating
spiff.markdown.edit Request to edit markdown in a fancy editor. Fired element The element that needs updating
value The current markdown content
spiff.markdown.update Update Markdown content for a paticular elements 'instructions'. Recieved element The element that needs updating
value Tne updated Markdown content
spiff.callactivity.edit Requst to edit a call activity by process id. Fired processId The Process the users wants to edit
spiff.callactivity.search Requst to search for a call activity Fired processUd The currently seleted process id
eventBus For sending back the selected process id.
spiff.callactivity.update Update the process id from a call activity (based on search) Received processId The Process the users wants to edit
spiff.file.edit request to edit a file, but file name. Fired value The file name the user wants to edit
spiff.dmn.edit request to edit a dmn by process id. Fired value The DMN id the user wants to edit
spiff.json_files.requested request a list of local json files. Fired optionType The type of options required ('json' or 'dmn')
spff.dmn_files.requested request of list of local dmn files.
spiff.json_files.returned Return a list of available json files Recieved options [{lable:'My Label', value:'1'}]
spff.dmn_files.returned Return a list of available dmn files. Recieved options [{lable:'My Label', value:'1'}]