ROCKFlows / FromMLWFConfigurationToBPMN

This project aims (i) to record workflows (meta and instance) defined in BPMN (XML parking) extended by a small constraint language, (ii) to merge and verify the knowledge contained and (iii) to transform them into a system of constraints (Feature model) in order to facilitate the selection of a workflow adapted to a new problem.
GNU General Public License v3.0
1 stars 1 forks source link

FromMLWFConfigurationToBPMN

Java CI with Maven Quality Gate Status

Overview

The ml2wf project aims at helping Data Scientists to create their workflows in the BPMN standard from a FeatureModel and to capitalize on their knowledge from new BPMN workflows.

You can define your own constraints easily by commenting your workflow using a predefined and customizable syntax.

Once created and modified, the data scientist can merge the workflow into the FeatureModel and reuse it later.

Furthermore, it will allow data scientists to reduce meta-learning space and, over time, automate the creation of workflows tailored to a given time series anomaly detection problem.

Table of contents

Usage

Command line

NAME
ml2wf  Machine Learning problem to Workflow
SYNOPSIS
ml2wf generate -i file -o directory [-v level]
ml2wf build -f FeatureModel -m metaDirectory -i instanceDirectory [-b] [-v level]
ml2wf merge [--meta|--instance] -i file -o FeatureModel [-fb] [-v level]
ml2wf save -i meta instance -o FeatureModel [-b] [-v level]
DESCRIPTION
Commands
generate  generate a workflow
build     build a FeatureModel from a set of workflows
merge     import a worklow in a FeatureModel
save      save a meta-workflow and its instance in a FeatureModel
Arguments
-i, --input       input path
-o, --output      output path
-b, --backup      backup the original FeatureModel file before any modification
-f, --full        process a full merge (including meta/instance relationship)
-v, --verbose     verbose mode (0=OFF,1=FATAL,2=ERROR,3=WARN,4=INFO,5=DEBUG,6=TRACE,7=ALL)

Configuration

The default configuration is the following :

# constraints syntax (name : arity : symbol)

before : 2 : >>
after : 2 : <<

imp : 2 : =>
equ : 2 : <=>

conj : 2 : &
disj : 2 : |

not : 1 : !

Note that you can change this configuration modifying the configuration.cfg under the ml2wf/config directory

Installation

Prerequisites

JDK 11

Maven

Build

cd ml2wf
mvn clean package

The generated .jar is located in the target directory.

Run

cd target
java -jar ml2wf.jar [command] [arguments]

Example

Lets consider this generic workflow : my_wf.bpmn2 :

generical_wf

and this initial feature model : featureModel.xml :

initial_fm

Step 1 : Instantiation & Modification

We instantiate our generic workflow using the generate command :

java -jar ml2wf.jar generate -i my_wf.bpmn2 -o result/

Note that the resulting instance will be located in the result directory with the name my_wf_instance.bpmn2.

We change the tasks names which give us :

instantiated_wf

Note that we put some constraints on our tasks (in comments).

=> We now have 3 possibilities to create our knowledge database (FeatureModel).

Step 2-A : Merging

We can merge our workflows in the FeatureModel using the merge command :

java -jar ml2wf.jar merge --meta -f -i my_wf.bpmn2 -o featureModel.xml
java -jar ml2wf.jar merge --instance -f -i result/my_wf_instance.bpmn2 -o featureModel.xml

Note that the -f argument will merge the meta/instance relationship

Beware a merge-instance only works properly if you use a generated workflow. Indeed in the XML (and not directly visible) _</bpmn2:task>_ gives information about the fact that the task must be considered as an instance, which will transform it into a concrete Feature. You can see the properties of a task by double-clicking on it.

Step 2-B : Saving

We can save the meta and instance relationship in the FeatureModel using the save command :

java -jar ml2wf.jar save -i my_wf.bpmn2 result/my_wf_instance -o featureModel.xml

Note that like any other command, unless the --backup (-b) argument is specified, the original FeatureModel will be modified without backing it up.

Step 2-C : Building

We can build the FeatureModel using our existing workflows and the build command :

java -jar ml2wf.jar build -f featureModel.xml -m my_wf.bpmn2 -i result/

Note that the -m/-i argument can be a directory. In that case, all workflows in the given directory will be merged in the FeatureModel.

=> Here is the result :

result_feature_model

Note that the workflows' constraints are translated into FeatureModel constraints in order to keep our knowledge database consistency.

Step 3 : Reusing your generated tasks for other workflows

Using the FeatureIDE, you now can select the wished tasks and it will automatically select the needed ones.

tasks_selection