Workspace 6.21.5
Functions
Workspace functions

Functions

CSIRO_WORKSPACEWEB_API int workspace_cancel_watch (const WorkspaceId *ws, const char *watchId)
 
CSIRO_WORKSPACEWEB_API int workspace_list_global_names (const WorkspaceId *ws, ListCallback callback)
 
CSIRO_WORKSPACEWEB_API int workspace_list_inputs (const WorkspaceId *ws, ListCallback callback)
 
CSIRO_WORKSPACEWEB_API int workspace_list_outputs (const WorkspaceId *ws, ListCallback callback)
 
CSIRO_WORKSPACEWEB_API int workspace_register_func_error (const WorkspaceId *ws, WorkspaceErrorCallback callback)
 
CSIRO_WORKSPACEWEB_API int workspace_register_func_failed (const WorkspaceId *ws, WorkspaceFailedCallback callback)
 
CSIRO_WORKSPACEWEB_API int workspace_register_func_success (const WorkspaceId *ws, WorkspaceSucceededCallback callback)
 
CSIRO_WORKSPACEWEB_API int workspace_run_continuously (const WorkspaceId *ws)
 
CSIRO_WORKSPACEWEB_API int workspace_run_once (const WorkspaceId *ws)
 
CSIRO_WORKSPACEWEB_API int workspace_set_global_name (const WorkspaceId *ws, const char *globalName, const char *content)
 
CSIRO_WORKSPACEWEB_API int workspace_set_input (const WorkspaceId *ws, const char *inputName, const char *content)
 
CSIRO_WORKSPACEWEB_API int workspace_stop (const WorkspaceId *ws)
 
CSIRO_WORKSPACEWEB_API int workspace_terminate (const WorkspaceId *ws)
 
CSIRO_WORKSPACEWEB_API int workspace_watch (const WorkspaceId *ws, JSONString watches, WatchCallback func, bool singleShot)
 

Detailed Description

Functions for acting on a particular workspace (client) asynchronously. Client applications must register callbacks for any information that they wish to receive.

Function Documentation

◆ workspace_cancel_watch()

CSIRO_WORKSPACEWEB_API int workspace_cancel_watch ( const WorkspaceId ws,
const char *  watchIdStr 
)
Parameters
wsThe workspace to remove the watch from
watchIdStrThe id of the existing watch request to cancel. Callbacks will no longer be invoked when the inputs / outputs / globalNames associated with this watch are brought up-to-date.

◆ workspace_list_global_names()

CSIRO_WORKSPACEWEB_API int workspace_list_global_names ( const WorkspaceId ws,
ListCallback  callback 
)
Parameters
wsThe ID of the workspace client process to observe.
callbackThe callback to invoke when the list data is received from the specified workspace client process.
Returns
true if the callback was successfully registered and the list request was sent, false otherwise.

◆ workspace_list_inputs()

CSIRO_WORKSPACEWEB_API int workspace_list_inputs ( const WorkspaceId ws,
ListCallback  callback 
)
Parameters
wsThe ID of the workspace client process to observe.
callbackThe callback to invoke when the list data is received from the specified workspace client process.
Returns
true if the callback was successfully registered and the list request was sent, false otherwise.

◆ workspace_list_outputs()

CSIRO_WORKSPACEWEB_API int workspace_list_outputs ( const WorkspaceId ws,
ListCallback  callback 
)
Parameters
wsThe ID of the workspace client process to observe.
callbackThe callback to invoke when the list data is received from the specified workspace client process.
Returns
true if the callback was successfully registered and the list request was sent, false otherwise.

◆ workspace_register_func_error()

CSIRO_WORKSPACEWEB_API int workspace_register_func_error ( const WorkspaceId ws,
WorkspaceErrorCallback  callback 
)
Parameters
wsThe ID of the workspace client process to observe.
callbackThe callback to invoke when the error signal is received from the specified workspace client process.
Returns
true if the callback was errorfully registered, false otherwise.

Associate an error callback with a client workspace process. When the client process emits the error event, the callback will be invoked.

◆ workspace_register_func_failed()

CSIRO_WORKSPACEWEB_API int workspace_register_func_failed ( const WorkspaceId ws,
WorkspaceFailedCallback  callback 
)
Parameters
wsThe ID of the workspace client process to observe.
callbackThe callback to invoke when the failed signal is received from the specified workspace client process.
Returns
true if the callback was failedfully registered, false otherwise.

Associate a failed callback with a client workspace process. When the client process emits the failed event, the callback will be invoked.

◆ workspace_register_func_success()

CSIRO_WORKSPACEWEB_API int workspace_register_func_success ( const WorkspaceId ws,
WorkspaceSucceededCallback  callback 
)
Parameters
wsThe ID of the workspace client process to observe.
callbackThe callback to invoke when the success signal is received from the specified workspace client process.
Returns
true if the callback was successfully registered, false otherwise.

Associate a success callback with a client workspace process. When the client process emits the success event, the callback will be invoked.

◆ workspace_run_continuously()

CSIRO_WORKSPACEWEB_API int workspace_run_continuously ( const WorkspaceId ws)
Parameters
wsThe ID of the workspace client process to run.
Returns
true if the run request was sent successfully, false otherwise.

Requests that the specified workspace client process begin executing in continuous mode. In continuous execution mode, a workflow will run until completion, then pause to wait for further updates. When any inputs or globalNames are set (using workspace_set_global_name or workspace_set_input), the workflow will automatically re-run the required parts of the workflow. Use workspace_watch to monitor changes to specific inputs, outputs or globalNames.

◆ workspace_run_once()

CSIRO_WORKSPACEWEB_API int workspace_run_once ( const WorkspaceId ws)
Parameters
wsThe ID of the workspace client process to run.
Returns
true if the run request was sent successfully, false otherwise.

Requests that the specified workspace client process begin executing in single-shot mode. In single-shot mode, a workflow will run until completion, then stop. To re-run it once it is complete, another call to workspace_run_once is required.

◆ workspace_set_global_name()

CSIRO_WORKSPACEWEB_API int workspace_set_global_name ( const WorkspaceId ws,
const char *  globalName,
const char *  content 
)
Parameters
wsThe ID of the workspace client process.
globalNameGlobalName to assign the content to.
contentSerialized content to be assigned to the specified globalName. Most integral types (e.g. ints, strings, doubles) are simple string representations of the values. For more complex types (e.g. DataCollection, DataSeries) this will be an XML representation of the data, identical to how this type is saved in a .wsx file.
Returns
true if the set global name request was sent successfully, false otherwise. If an error occurs while setting the global name, the error signal will be emitted.

Set the value of a specific input or output that has a globalName attached to it, assigning it the content provided. If the globalName cannot be found, if there is a serialization error, or if there is a datatype mismatch, and error will be reported by the client workspace process.

◆ workspace_set_input()

CSIRO_WORKSPACEWEB_API int workspace_set_input ( const WorkspaceId ws,
const char *  inputName,
const char *  content 
)
Parameters
wsThe ID of the workspace client process.
inputNameName of the top-level input to assign the content to.
contentSerialized content to be assigned to the specified input. Most integral types (e.g. ints, strings, doubles) are simple string representations of the values. For more complex types (e.g. DataCollection, DataSeries) this will be an XML representation of the data, identical to how this type is saved in a .wsx file.
Returns
true if the set input request was sent successfully, false otherwise. If an error occurs while setting the input, the error signal will be emitted.

Set the value of a specific input, assigning it the content provided. If the input cannot be found, if there is a serialization error, or if there is a datatype mismatch, and error will be reported by the client workspace process.

◆ workspace_stop()

CSIRO_WORKSPACEWEB_API int workspace_stop ( const WorkspaceId ws)
Parameters
wsThe ID of the workspace client process to terminate.
Returns
true if the set stop request was sent successfully, false otherwise.

Stops execution of the specified workspace client process. Once stopped, the Workspace can be restarted using workspace_run_continuously or workspace_run_once.

◆ workspace_terminate()

CSIRO_WORKSPACEWEB_API int workspace_terminate ( const WorkspaceId ws)
Parameters
wsThe ID of the workspace client process to terminate.
Returns
true if the set terminate request was sent successfully, false otherwise. If an error occurs while terminating the client process, the error signal will be emitted.

Terminates the specified workspace client process.

◆ workspace_watch()

CSIRO_WORKSPACEWEB_API int workspace_watch ( const WorkspaceId ws,
JSONString  watches,
WatchCallback  func,
bool  singleShot 
)
Parameters
wsThe id of the Workspace the watch is going to be set on.
watchesJSON string specifying the inputs, outputs and / or globalNames to watch for updates. When all of these are up-to-date, the callback function will be invoked. The JSON schema is as follows:
'type': 'object',
'prop': 'properties': {
    'inputs': { 'type': 'array' },
    'outputs': { 'type': 'array' },
    'globalNames': { 'type': 'array' }
}
An example JSON string conforming to this schema is:
{
    'inputs': ['input_one', 'input_two']
    'outputs': ['result']
    'globalNames': ['test_name']
}
funcThe callback function to invoke when all of the updatables in the watch list are up-to-date.
singleShotIf true, indicates that this watch is a one-time-update only. If false, the callback will be invoked every time the watch list is brought up-to-date.
Returns