A data provider is responsible for creating scenarios providing access to all known or anticipated process instances and all known or anticipated attribute values.
Static data provider
The static data provider can be used in situations where all instances and all initialization values of attributes are either known or undefined.
Below is a minimal example creating a scenario containing instances of a BPMN model.
#include <bpmnos-model.h>
int main() {
auto scenario = dataProvider.createScenario();
}
Class representing a data provider for static BPMN instance data.
The model is stored in the file diagram.bpmn and the data is provided in the file scenario.csv. Below is an example showing the structure of the data file.
PROCESS_ID; INSTANCE_ID; ATTRIBUTE_ID; VALUE
MachineProcess;Machine1;Jobs;2
MachineProcess;Machine2;Jobs;3
MachineProcess;Machine3;Jobs;3
OrderProcess;Order1;Machines;["Machine1","Machine2","Machine3"]
OrderProcess;Order1;Durations;[3,2,2]
OrderProcess;Order2;Machines;["Machine1","Machine3","Machine2"]
OrderProcess;Order2;Durations;[2,1,4]
OrderProcess;Order3;Machines;["Machine2","Machine3"]
OrderProcess;Order3;Durations;[4,3]
The data file must begin with a header PROCESS_ID; INSTANCE_ID; ATTRIBUTE_ID; VALUE. Then each of the subsequent lines contains attribute values for a specific process instance. Values provided for string attributes must be quoted, values provided for boolean attributes must be true or false, and values provided for collection attributes must be embraced in square brackets.
Alternatively, the instance data may be provided by a string as shown in below example.
#include <bpmnos-model.h>
#include <string>
int main() {
std::string csv =
"PROCESS_ID; INSTANCE_ID; ATTRIBUTE_ID; VALUE\n"
";;Items;3\n"
";;Bins;3\n"
"BinProcess;Bin1;Capacity;40\n"
"BinProcess;Bin2;Capacity;40\n"
"BinProcess;Bin3;Capacity;40\n"
"ItemProcess;Item1;Size;20\n"
"ItemProcess;Item2;Size;15\n"
"ItemProcess;Item3;Size;22\n"
;
auto scenario = dataProvider.createScenario();
}
Dynamic data provider
- Bug
- The implementation of the BPMNOS::Model::DynamicDataProvider is not yet completed.
Stochastic data provider
- Note
- Currently, there is no implementation for a stochastic data provider.
Real-life monitor
- Note
- Currently, there is no implementation for a real-life monitor.