selectTask {openMpp}R Documentation

Select modeling task

Description

Select modeling task text (name, description, notes) and input workset id's

Usage

selectTask(dbCon, taskId)

Arguments

dbCon

database connection

taskId

id of modeling task

Details

This call return task text (name, description, notes) and input workset id's.

Value

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

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

[Package openMpp version 0.8.6 Index]