MBSE Integration Services for Integrating Modeling Tools
bhmSaveAsOperation API
Use the following API to create a copy of an existing model and save it to Teamcenter.
If the model has reusable blocks, the SaveAs operation creates new copies of the reusable blocks.
List<BHMOperationOutput> bhmSaveAsOperation (List<String> dataSaveAsInputXMLs, String toolType)
Inputs
dataSaveInputXML — Specifies a list of input strings that are based on the BHMOperationsSchema.xsd file. You can generate the xml string using the JAXB utility available with the BHMOperationData and BHMDesign classes in the com.teamcenter.behaviormodeling.common.xml package.
Note: You can also generate the input XML string using the bhmPreSaveOperation API. Provide the details of the model to be copied, such as the staging directory, and generate the XML file and update the output of this API.
toolType — Specifies the behavior modeling tool, for example, MATLAB.
In your Java code, you must specify the following:
- In the BHMOperations element, specify the values for rootModelFolder, rootModelName, and rootModelIdentifier.
- In the Model element: specify the values for modelName and modelIdentifier, and specify the value of tcuid.
- In the Attributes element, specify the value of item_id, item_revision_id, and object_name. If you do not specify these IDs, Teamcenter automatically generates them.
<Attributes>
<Key name="item_id">
<Value>000300</Value>
</Key>
<RevisionAttributes>
<Key name="object_name">
<Value>M11SaveAs</Value>
</Key>
<Key name="item_revision_id">
<Value>D</Value>
</Key>
</RevisionAttributes>
</Attributes>
In the saveOperationOptions element, specify values for the following variables:
- folderUID — Saves the model to the Teamcenter folder specified by the folder UID.
- checkIn — Set the value to false as you cannot check in a new model.
- addAdditionalData — To copy additional data from the original model to the new model, set the value to true.
Outputs
The output is a list of BHMOperationOutput objects (com.teamcenter.behaviormodeling.common package). Each object corresponds to one of the input XML strings sent through dataSaveInputXML.
| BHMOperationOutput variable | Description |
|---|---|
| OperationStatus | Returns one of: OPERATION_FAILED, OPERATION_WARNING, OPERATION_SUCCESSFUL, OPERATION_SUCCESSFUL_WITH_INFO |
| message | Specifies the cause of the API failure. |
| inputXML | Specifies the input XML string based on BHMOperationsSchema.xsd. |
| outputXML | Specifies an XML string based on BHMDesignSchema.xsd. |
| rootModelName | Specifies the root model to be saved. |
| rootModelIdentifier | Specifies the identifier of the root model. |
| rootModelFullFilePath | Specifies the full path of the root model. |
Example
To create a copy of a model and save it to Teamcenter, you can pass the following string through the dataSaveInputXML list of the bhmSaveOperation API.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<BHMOperations rootModelFolder="D:\staging_11\M11_000260_A\M112" rootModelName="M11"
rootModelIdentifier="M11"xmlns="http://www.plmxml.org/Schemas/bhm">
<modelInfo applicationName="MATLAB">
<Model modelName="M11" modelIdentifier="M11" tcuid="g_Zhgh35IvwBJA"
tcitemId="000295" tcrevId="A" tcItemName="M11" instanceType="ModelReference"
tcType="Bhm0BehaviorModl" lastSavedTimeStamp="0"
createdDate="Tue May 12 12:24:22 2015" isRoot="true"
containerModel="true" objectType="Model">
<Attributes>
<Key name="item_id">
<Value>000300</Value>
</Key>
<RevisionAttributes>
<Key name="object_name">
<Value>M11SaveAs</Value>
</Key>
<Key name="item_revision_id">
<Value>D</Value>
</Key>
</RevisionAttributes>
</Attributes>
<Contents>
<ModelElements/>
</Contents>
</Model>
</modelInfo>
<options>
<saveOperationOptions folderUID="AWSdOLciIvwBJA" checkIn="false"
addAdditionalData="true"/>
</options>
</BHMOperations>
Source: https://docs.sw.siemens.com/en-US/doc/282219420/PL20251212545240207.xid1913857/xid1325154 · retrieved Fri Jul 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)