getTaskIdByName {openMpp} | R Documentation |
Return modeling task id by name
getTaskIdByName(dbCon, defRs = NA, taskName)
dbCon |
database connection |
defRs |
(optional) model definition: database rows describing model input parameters and output tables |
taskName |
name of modeling task |
Return modeling task id by name.
If there is no task with that name then return is negative.
If there are multiple tasks with that name then return min(task id) with such name.
If model definition defRs
argument supplied then search for within specific model.
Modeling task is named set of model inputs and contains name and vector of model workset id's.
Please see createWorkset
for mode details about workset (workset: working set of model input parameters).
Modeling task is a convinient way to bundle together multiple inputs of the model. After task created you can run the model with specifing task name or task id and model will iterate through task input worksets and produce output result for each of those inputs.
modeling task id: positive integer on success or negative 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
createTask
selectTask
selectTaskRun
theDb <- dbConnect(RSQLite::SQLite(), "modelOne.sqlite", synchronous = "full") invisible(dbGetQuery(theDb, "PRAGMA busy_timeout = 86400")) # recommended # try to find "taskOne" task id for any model taskId <- getTaskIdByName(theDb, taskName = "taskOne") if (taskId <= 0L) warning("task not found: ", "taskOne") # get model by name: use such call if you have only one version of the model defRs <- getModel(theDb, "modelOne") # try to find "taskOne" task id for "modelOne" taskId <- getTaskIdByName(theDb, defRs, "taskOne") if (taskId <= 0L) warning("task not found: ", "taskOne") dbDisconnect(theDb)