Main Content

updateSrcFileLocation

Class: slreq.ReqSet
Namespace: slreq

Update document location of imported requirements

Syntax

updateSrcFileLocation(rs,oldID,newID)

Description

updateSrcFileLocation(rs,oldID,newID) updates the Artifact property from oldID to newID for the referenced requirements in the requirement set rs that have Artifact set to oldID. Use this function to update the stored external requirements document name and path associated with the imported referenced requirements.

Input Arguments

expand all

Requirement set, specified as an slreq.ReqSet object.

Resource identifier for the original external document, specified as a string scalar or character vector.

Resource identifier for the new external document, specified as a string scalar or character vector.

Examples

expand all

This example shows how to update the source artifact for referenced requirements from an external requirements document from an external requirements document with a different name from the original document, and then update the requirements.

Load the crs_req requirement set.

rs = slreq.load("crs_req");

Get a handle to the import node of the requirement set.

topRef = children(rs);

Get the name of the external requirements document that the requirements were imported from.

oldDoc = topRef.Artifact
oldDoc = 
'crs_req.docx'

Update the source artifact for the referenced requirements to the document with the name crs_req_new.docx.

updateSrcFileLocation(rs,oldDoc,"crs_req_new.docx")

Check if the import node has an available update.

tf = hasNewUpdate(topRef)
tf = logical
   1

Update the referenced requirements.

[status,changelist] = updateFromDocument(topRef)
status = 
'Update completed. Refer to Comments on Import1.'
changelist = 
    'Updated: CC003_01. Properties: description
     Updated: CC003_02. Properties: description
     Updated: CC003_03. Properties: description
     Updated: CC003_04. Properties: description
     Updated: Cruise Control SET Indicator Light. Properties: description
     Updated: Cruise control buttons. Properties: description
     Updated: Cruise control mode indicator. Properties: description
     Deleted: Cruise control modes
     Updated: Dashboard image. Properties: description
     Inserted: Dashboard image_1
     Updated: Deactivating cruise control. Properties: description
     Deleted: Disabling cruise control
     Updated: Enabling cruise control. Properties: description
     Updated: Other inputs. Properties: description
     Updated: ROM. Properties: description
     Updated: Resuming cruise control. Properties: description
     Inserted: Simulink_requirement_item_1
     Inserted: Simulink_requirement_item_10
     Inserted: Simulink_requirement_item_11
     Inserted: Simulink_requirement_item_12
     Inserted: Simulink_requirement_item_13
     Inserted: Simulink_requirement_item_14
     Inserted: Simulink_requirement_item_15
     Inserted: Simulink_requirement_item_2
     Inserted: Simulink_requirement_item_3
     Inserted: Simulink_requirement_item_4
     Inserted: Simulink_requirement_item_5
     Inserted: Simulink_requirement_item_6
     Inserted: Simulink_requirement_item_7
     Inserted: Simulink_requirement_item_8
     Inserted: Simulink_requirement_item_9
     Updated: Successive Target Speed Increment. Properties: description
     Updated: System Inputs. Properties: description
     Updated: System outputs. Properties: description
     Updated: Target Speed Increment. Properties: description
     Updated: Target speed decrement. Properties: description
     Updated: Throttle value calculation. Properties: description
     Inserted: When the vehicle is started. Cru
     Inserted: boolean
     Inserted: boolean_1
     Inserted: boolean_2
     Inserted: boolean_3
     Inserted: boolean_4
     Inserted: boolean_5
     Updated: crs_req_new. Properties: summary
     Inserted: single
     Inserted: single_1
     Inserted: single_2
     Inserted: uint8
     Inserted: uint8_1
     '

Tips

  • To change the stored name and path of the external requirements document and update the imported referenced requirements under the import node, use the updateFromDocument method.

  • To update the link destinations for direct links when you rename or move an external requirements document, use the updateDocUri method.

  • To update the external requirements document resource identifier for referenced requirements imported from non-file-based domains, use the updateSrcArtifactUri method.

Version History

Introduced in R2017b