Documentation status
| Version |
Date |
Notes |
By |
| 1.0 |
2020-09-11 |
Initial release |
ROB |
| 1.1 |
2020-10-12 |
Added dates and multiple variable flows |
ROB |
| 1.1 |
2020-10-13 |
Added section about sockets |
ROB |
Intro
WeFlow™ is a visual flow based programming language designed to handle "Programming in the small" problems when using the BPMN process engine. Is is currently used for handling gateway operations, mathematical calculations, string operations (concatenate), array operations (contains), variable editing and instancing as well as interactions with other SGI modules.
Using one or more input components, one or more transformative / operation components and one or more exit components you can create a WeFlow script (enbedded in a BPMN activity or gateway) that will then be executed by BPMN process engine.
This language uses the inputs to move data through connections to the next component, each component accepts inputs (data), and may change / produce new data from both inputs and options in the component itself. This altered / generated data is moved to outputs ready to be moved to an exit.
WeFlow™ depends on an execution context that change the available exits in a given script. For example in gateways, the exit determines which paths are available. In script activities it is possible to edit / instance variables.
Sockets
Sockets regulate how the components interact, there are multiple types of sockets, Attribute, Relation and Flow sockets (see "Muliple variable flows" for more information on flow sockets).
Attribute sockets "transport" the value of an attribute from one component to the next. Relation attributes "transport" an entire variable or collection of variables (depending on whether the multiplicity of a relation is "single" or "multiple").

Sockets explained
Available components
Entry components
- Case - One case entry is created for every base variable definition.
- Fixed variable entry - This component provides a way to declare constant values, for use further down the script.
Dates
- Date decomposer - Breaks down a date into it's constituent parts (year, day, month, ...).
- Date comparison - Compares two dates using a signal (before than, equals, is diferent) and returns true or false.
Arithmetic components
- Mixed arithmetic component - Provides basic mathematical operations between 2 inputs (sum, subtration, multiplication, division, modulus).
- Attribute collection arithmetic - Provides SUM and AVG arithmetic operations that are executed on a given multiple relation input (array of variables).
Logic components
- Mixed boolean comparison - Provides basic logic operations between 2 inputs (equal, less than, greater than, less than or equal, greater than or equal, diferent).
- Boolean compare variable array - Loops through an array of variables and returns true if a given attribute is equal to provided value in every member of array (ALL) or at least one member of array (ANY).
- Test multiple attribute contains single attribute value - Returns true if an attribute of type multiple contains a value from the same attribute of type single.
- Boolean operation - Evaluates two boolean inputs acording to a boolean operation (and, or).
Multiple variable flows
- Multiple variable unfold - Unfolds a multiple variable connection into a flow connection.
- Multiple variable folds - Folds a flow connection back into a multiple variable connection.
- Multiple variable filter by attribute - Filters a multiple variable connection by attribute using a sign (equals, is diferent, ...).
Exit components
- Case - One case exit is created for every base variable definition.
- Add attribute - Adds an attribute to a base variable instance (even if definition does not have it).
- Instance and attach variable - Instances a non base variable and attaches it to existing base variable instance.
Other (Special) Components
- Case pdf - Forces generation of the case PDF (and makes it available as an output).
- Concatenate - Concatenates 2 input strings (or mixed, using php rules).