The Workflow class allows you to read and write workflow files. More...
The T/HIS JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
Detailed DescriptionThe Workflow class gives you simple functions to read and write workflow files |
Details of functionsModelIdFromIndex(model_index[integer], workflow_name (optional)[string]) [static]DescriptionReturns the id of a model selected by the user by index (starting at 0). |
The index of the model to return the unit system for. If the workflow is run from the workflow menu and the name argument is not defined, it is the index in the list of models selected by the user. If the workflow is run from the workflow menu and the name argument is defined, it is the index of the model that has user data for the named workflow, out of the list of models selected by the user. If the workflow is run from REPORTER, it is the index in the list of all the models loaded in the session that have user data for the named workflow.
The workflow name to return the model id for.
Returnsinteger Return typeNumber |
ModelUnitSystemFromIndex(model_index[integer], workflow_name (optional)[string]) [static]DescriptionReturns the unit system of a model selected by the user by index (starting at 0). Will be Workflow.UNIT_SYSTEM_NONE or Workflow.UNIT_SYSTEM_U1 or Workflow.UNIT_SYSTEM_U2 or Workflow.UNIT_SYSTEM_U3 or Workflow.UNIT_SYSTEM_U4 or Workflow.UNIT_SYSTEM_U5 or Workflow.UNIT_SYSTEM_U6 |
The index of the model to return the unit system for. If the workflow is run from the workflow menu and the name argument is not defined, it is the index in the list of models selected by the user. If the workflow is run from the workflow menu and the name argument is defined, it is the index of the model that has user data for the named workflow, out of the list of models selected by the user. If the workflow is run from REPORTER, it is the index in the list of all the models loaded in the session that have user data for the named workflow.
The workflow name to return the unit system for.
Returnsinteger Return typeNumber |
The index of the model to return the program build number for.
The workflow name to return the build number for. This is required when a PRIMER item is generated from REPORTER. If it is not specified the build number for the first user data associated with the model is returned (this is the 'normal' case where a user launches a workflow from the workflow menu).
Returnsnumber Return typenumber |
ModelUserDataFromIndex(model_index[integer], workflow_name (optional)[string]) [static]DescriptionReturns the user data associated with a model by index (starting at 0). |
The index of the model to return the user data for. If the workflow is run from the workflow menu and the name argument is not defined, it is the index in the list of models selected by the user. If the workflow is run from the workflow menu and the name argument is defined, it is the index of the model that has user data for the named workflow, out of the list of models selected by the user. If the workflow is run from REPORTER, it is the index in the list of all the models loaded in the session that have user data for the named workflow.
The workflow name to return the user data for.
Returnsobject Return typeObject |
The index of the model to return the program name for.
The workflow name to return the program name for. This is required when a PRIMER item is generated from REPORTER. If it is not specified the program name for the first user data associated with the model is returned (this is the 'normal' case where a user launches a workflow from the workflow menu).
Returnsstring Return typeString |
The index of the model to return the program version for.
The workflow name to return the version for. This is required when a PRIMER item is generated from REPORTER. If it is not specified the version for the first user data associated with the model is returned (this is the 'normal' case where a user launches a workflow from the workflow menu).
Returnsnumber Return typenumber |
NumberOfSelectedModels(workflow_name (optional)[string]) [static]DescriptionReturns the number of models selected by the user. |
The workflow name to return the number of models for. If it's not defined the number of models that were selected by the user on the workflow menu is returned. If it's defined and the workflow was run from the workflow menu, the number of models, out of the models selected by the user, that have data for the named workflow is returned. If it's defined and the workflow is run from REPORTER, the number of models, out of all the models loaded in the session, that have data for the named workflow is returned.
Returnsinteger Return typeNumber |
Refresh() [static]DescriptionScan for fresh workflow data |
No arguments
ReturnsNo return value |
Example
Workflow.Refresh();
|
WorkflowDefinitionFilename(workflow_name (optional)[string]) [static]DescriptionReturns the workflow definition filename |
The workflow name to return the workflow defintion filename for. This is required when a POST item is generated from REPORTER. If it is not specified the first workflow user data associated with the model is returned (this is the 'normal' case where a user launches a workflow from the workflow menu).
Returnsstring Return typeString |
ExampleTo get the worklow definition filename that the script has been run with
var workflow_definition_filename = Workflow.WorkflowDefinitionFilename();
|
Object containing user data required for the workflow.
Filename to write to.
Filename of the workflow definition file.
Extra workflow information
Object has the following properties:
| Name | Type | Description |
| model_unit_system (optional) | integer | The model unit system. Can be Workflow.UNIT_SYSTEM_NONE or Workflow.UNIT_SYSTEM_U1 or Workflow.UNIT_SYSTEM_U2 or Workflow.UNIT_SYSTEM_U3 or Workflow.UNIT_SYSTEM_U4 or Workflow.UNIT_SYSTEM_U5 or Workflow.UNIT_SYSTEM_U6 |
ReturnsNo return value |