selectTaskList {openMpp}R Documentation

Select list of modeling tasks

Description

Select list of modeling tasks for the model

Usage

selectTaskList(dbCon, defRs)

Arguments

dbCon

database connection

defRs

model definition: database rows describing model input parameters and output tables

Details

This call return list of tasks for specified model.

Value

List of database rows:

taskLst

task_lst rows: task id and name

taskTxt

task_txt rows: language, description, notes

Note

To run examples you must have modelOne database modelOne.sqlite in current directory

Author(s)

amc1999

References

OpenM++ documentation: https://github.com/openmpp/openmpp.github.io/wiki

See Also

getModel getTaskIdByName getTaskFirstRunId getTaskLastRunId selectTask selectTaskRun selectTaskRunList

Examples

  #
  # 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 <- selectTaskList(theDb, taskId)
  
  # select list of all tasks for the model
  taskLstRs <- selectTaskList(theDb, defRs)
  
  dbDisconnect(theDb)

[Package openMpp version 0.8.6 Index]