| getDefaultWorksetId {openMpp} | R Documentation |
Return default working set id for the model
getDefaultWorksetId(dbCon, defRs)
dbCon |
database connection |
defRs |
model definition: database rows describing model input parameters and output tables |
Return id of model "default" working set of parameters.
If model have no default working set then execution stops.
Each model must have "default" workset. Default workset is a first workset of the model with set_id = min(set_id) for that model.
Working set id: positive integer on success or negative on error. Stop if not found.
To run examples you must have modelOne database modelOne.sqlite in current directory
amc1999
OpenM++ documentation: https://github.com/openmpp/openmpp.github.io/wiki
getModel
getFirstRunId
getLastRunId
getWorksetIdByName
getWorksetRunIds
theDb <- dbConnect(RSQLite::SQLite(), "modelOne.sqlite", synchronous = "full")
invisible(dbGetQuery(theDb, "PRAGMA busy_timeout = 86400")) # recommended
# get model by name: use such call if you have only one version of the model
defRs <- getModel(theDb, "modelOne")
# get default working set id by name, it expected to be exist
setId <- getDefaultWorksetId(theDb, defRs)
# try to find "myData" working set id
setId <- getWorksetIdByName(theDb, defRs, "myData")
if (setId <= 0L) warning("workset not found: ", "myData")
dbDisconnect(theDb)