| selectTask {openMpp} | R Documentation |
Select modeling task text (name, description, notes) and input workset id's
selectTask(dbCon, taskId)
dbCon |
database connection |
taskId |
id of modeling task |
This call return task text (name, description, notes) and input workset id's.
List of database rows:
taskLst |
task_lst row: task id and name |
taskTxt |
task_txt rows: language, description, notes |
taskSet |
task_set rows: task input workset id's |
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
getTaskIdByName
getTaskFirstRunId
getTaskLastRunId
selectTaskList
selectTaskRun
selectTaskRunList
#
# connect to database
#
theDb <- dbConnect(RSQLite::SQLite(), "modelOne.sqlite", synchronous = "full")
invisible(dbGetQuery(theDb, "PRAGMA busy_timeout = 86400")) # recommended
# get definition for "modelOne" model
#
# use model name only to identify the model
# if there are multiple versions of the model in database
# then first one is selected: where model id = min(model_id) for "modelOne"
#
defRs <- getModel(theDb, "modelOne")
taskId <- getTaskIdByName(theDb, defRs, "taskOne")
if (taskId <= 0L) stop("task: ", "taskOne", " not found for model: ", defRs$modelDic$model_name, " ", defRs$modelDic$model_digest)
# select task name, description and input list
taskRs <- selectTask(theDb, taskId)
# select list of all tasks for the model
taskLstRs <- selectTaskList(theDb, defRs)
dbDisconnect(theDb)