33# '
44# ' @param app the app list object or just the app name its
55# ' character text value.
6- # '
6+ # ' @param ssid the session id for multiple user environment, default NULL means global user environment
7+ # '
78# ' @return a character vector of the workspace directory path
89# ' of the specific analysis application.
910# '
1011# ' @details the verbose option could be config from the
1112# ' commandline option: ``--verbose``
1213# '
13- const workspace = function (app ) {
14+ const workspace = function (app , ssid = NULL ) {
1415 const verbose = as.logical(getOption(" verbose" ));
15- const context = .get_context();
16+ const context = .get_context(ssid );
1617 const temp_root = context $ temp_dir ;
1718 const app_name = get_app_name(app );
1819 const workdir = normalizePath(`${temp_root}/workflow_tmp/${app_name}/` );
@@ -42,42 +43,47 @@ const workspace = function(app) {
4243# ' 1. app tuple list object, which is created via the ``app`` function.
4344# ' 2. the app name character vector
4445# ' 3. the workfile path expression, should be in format like: ``app://relpath/to/file.ext``
46+ # ' @param ssid the session id for multiple user environment, default NULL means global user environment
47+ # '
48+ # ' @return the data file path of the required reference file inside this workflow
4549# '
4650# ' @details the workfile path expression is in format string of: ``app://filepath``,
4751# ' example as ``getMzSet://mzset.txt``, where we could parse the reference information
4852# ' from this character string: app name is ``getMzSet``, and the relpath data is
4953# ' ``mzset.txt``. so, such configuation could be equals to the function invoke
5054# ' of the workfile function: ``workfile("getMzSet", "/mzset.txt");``.
5155# '
52- const workfile = function (app , relpath = NULL ) {
56+ const workfile = function (app , relpath = NULL , ssid = NULL ) {
5357 if (is.empty(relpath )) {
5458 if (is.character(app )) {
5559 relpath <- __workfile_uri_parser (app );
5660
5761 # gets the internal workfile reference
5862 # its physical file path
59- file.path(WorkflowRender :: workspace(relpath $ app ), relpath $ file );
63+ file.path(WorkflowRender :: workspace(relpath $ app , ssid ), relpath $ file );
6064 } else {
6165 throw_err(" the given expression value should be an internal workfile path reference!" );
6266 }
6367 } else {
64- file.path(WorkflowRender :: workspace(app ), relpath );
68+ file.path(WorkflowRender :: workspace(app , ssid ), relpath );
6569 }
6670}
6771
6872# ' Get workspace root directory
6973# '
74+ # ' @param ssid the session id for multiple user environment, default NULL means global user environment
7075# ' @details actually this function will returns the ``output`` dir
7176# ' path which is set via the ``init_context`` function
7277# '
73- const workdir_root = function () {
74- .get_context()$ root ;
78+ const workdir_root = function (ssid = NULL ) {
79+ .get_context(ssid )$ root ;
7580}
7681
7782# ' get directory folder path for the analysis output result
7883# '
84+ # ' @param ssid the session id for multiple user environment, default NULL means global user environment
7985# ' @details a character vector of the analysis result output directory.
8086# '
81- const result_dir = function () {
82- .get_context()$ analysis ;
87+ const result_dir = function (ssid = NULL ) {
88+ .get_context(ssid )$ analysis ;
8389}
0 commit comments