Free Business Process Simulation Modeling Software

API usage examples

Model

app.model
Business Process Model Object

{
    "info": {
                "id":           "856eb218-342a-4435-9ebd-ebcfd328",
                "name":         "Model Name",
                "description":  null,
                "created":      "Tue, 19 Mar 2019 15:18:47 GMT",
                "lastSaved":    null,
                "revision":     0,
                "coreVersion":  null,
                "filename":     null
            },
    "objects": {}
}
api.model.create()
Create a new model.
api.model.open(data,fileId)
Open the model from the data variable. Data can be a string or an object. FileId - identifier of the physical location of the file (file system path or storage identifier in the cloud).
api.model.save(storage,callback)
Save model to storage. Storage - storage identifier from the list app.options.types.storage. Callback - event will fired at the end of the operation.
api.model.copy()
Create a copy of the model.

Model.items

Business Process Model Items

app.model.items.add(class,properties)
Create a new class model object app.options.types.objClass. Properties - object with properties for rewriting base class.
{
                "id": "afa3008e-9933-4c30-9662-4f4a1150",
                "name": "Super Function 13",
                "position": {
                    "top": 0,
                    "left": 0
                },
                "objType": "bpObject",
                "prior": {
                    "objects": [],
                    "execLogic": 1
                },
                "next": {
                    "objects": [],
                    "allocLogic": 0
                },
                "_simulation": {
                    "passedCount": 0
                },
                "objClass": "bpFunction",
                "input": {
                    "objects": []
                },
                "output": {
                    "objects": []
                },
                "regulate": {
                    "objects": []
                },
                "execute": {
                    "objects": [],
                    "execResource": 0
                },
                "support": {
                    "objects": []
                },
                "runTimeMin": 1,
                "runTimeMax": 1,
                "runTimeMult": 60,
                "batchSize": 1,
                "batchFill": false
            }
api.model.items.copy(source, properties)
Create a copy of the source model object and rewrite the values with the properties object.
api.model.items.clone(source)
Create a hard copy of the source model object.
api.model.items.import(source, properties)
Create a copy of the source model object and import properties into it.
api.model.items.remove(ID)
Remove from the model an instance of an object with an ID.

App

api.app.setSnapshot(isNew)
Create a copy of the model in the application model change history. IsNew (boolean) - create new change history model.
api.app.getSnapshot(forward)
Open a copy of the model from the application model change history. Forward (boolean) - Direction forward / backward relative to the current pointer.