Skip to main content
Version: v4.5

Model import

Stream processing for model import#

The model is imported with stream processing to allow for the smooth loading of large projects.

Previously, the BIMPK uploader orchestrator had two separate steps to extract and upload the model data sequentially, which are sequence numbers 2 and 3:

Sequential processing orchestrator example


let datasourceResult = await IafScriptEngine.addDatasource(  {    _name: "BIMPK Uploader",    _description: "Orchestrator to upload model from BIMPK file",    _namespaces: proj._namespaces,    _userType: "bimpk_uploader",    _params: {      tasks: [        {          name: "folder_cleaner_target",          _sequenceno: 5        },        {          name: "scz_relations_target",          _sequenceno: 4        },        {          name: "default_script_target", //step that uploads model elements          _actualparams: {            userType: "iaf_bimpk_upload",            _scriptName: "uploadBimpk"          },          _sequenceno: 3        },        {          name: "bimpk_element_extractor", //step that extracts model elements          _sequenceno: 2        },        {          name: "bimpk_file_extractor",          _sequenceno: 1        }      ]    }  },  ctx);

For stream processing, this has been condensed to a single step, sequence number 2, which extracts and uploads data in 9MB chunks:

Stream processing orchestrator example

let datasourceResult = await IafScriptEngine.addDatasource(  {    "_name": "BIMPK Import",    "_description": "BIMPK Import",    "_namespaces": project._namespaces,    "_userType": "bimpk_import",    "_schemaversion":"2.0",    "_params": {      "tasks": [        {          "name": "folder_cleaner_target",          "_sequenceno": 4        },        {          "name": "scz_relations_target",          "_sequenceno": 3        },        {          "name": "default_script_target", //step that combines extraction and upload of model elements in stream process          "_actualparams": {            "userType": "iaf_import_model",            "_scriptName": "importModel",          },          "_sequenceno": 2        },        {          "name": "bimpk_file_extractor",          "_sequenceno": 1        }      ]    }  },  ctx);

The default_script_target orchestrator step uses the importModel function from the iaf_import_model script. The importModel function calls the occurrenceStreaming function, which handles the stream processing.