I’m developing an open source Elixir BPM library (application). You can find it here:
https://github.com/CharlesIrvineKC/mozart
Right now it’s somewhere between a prototype and an MVP.
Instead of defining process models using BPMN (a graphical notation for visually specifying business processes), my goal is to create a highly readable textual process definition language.
Currently, process models are defined using Elixir maps and structs. I have a number of working examples now. They are in:
https://github.com/CharlesIrvineKC/mozart/blob/main/lib/mozart/test_models.ex
They can be run by running tests:
$ mix test
However, if you take a look at the process models defined in the file “test_models.ex” you will see that they anything but “readable”.
Here is an example process model that is runnable with the process engine:
%ProcessModel{
name: :two_service_tasks,
tasks: [
%Task{
name: :add_one,
function: fn data -> Map.put(data, :value, data.value + 1) end,
next: :add_two
},
%Task{
name: :add_two,
function: fn data -> Map.put(data, :value, data.value + 2) end,
next: nil
},
]
}
What I would like to write instead is something like:
defprocess two_service_tasks do
call_service add_one do value = value + 1 end
call_service add_two do value = value + 2 end
end
This is obviously much more readable.
This brings me to my purpose in posting. The last time that I implemented a parser I used Bison and Yacc. I wrote an embedded C-like programming language that was incorporated into a CAD tool, but this was many years ago.
Does anyone have any opinion on possibly using NimbleParsec to perform the translation? Or, are there other alternatives that I should look at?
If you have any questions or comments regarding the library, feel free to raise them with an GitHub issue on the project.
Thanks