Main Content

moveUp

Class: slreq.Justification
Namespace: slreq

Move justification up in hierarchy

Since R2020b

Syntax

tf = moveUp(jt)

Description

tf = moveUp(jt) moves the justification jt up one spot in the hierarchy, and returns 1 if the move executes without error. The justification jt cannot be moved to a new level in the hierarchy.

Input Arguments

expand all

Justification, specified as an slreq.Justification object.

Output Arguments

expand all

Paste success status, returned as a 0 or 1 of data type logical.

Examples

expand all

This example shows how to move a justification up in the hierarchy.

Load the crs_req_justs requirement file, which describes a cruise control system, and assign it to a variable. Find the justification with index 5.3.

rs = slreq.load('crs_req_justs');
jt1 = find(rs,'Type','Justification','Index','5.3');

Move the justification up one spot in the hierarchy. Confirm the move by checking the success status, tf1, and the index.

tf1 = moveUp(jt1)
tf1 = logical
   1

jt1.Index
ans = 
'5.2'

Find the justification with index 5.1. This justification is already at the top of its level in the hierarchy and cannot be moved up further, which you can verify by trying to move it up. Confirm that the move failed by checking the success status, tf2, and the index.

jt2 = find(rs,'Type','Justification','Index','5.1');
tf2 = moveUp(jt2)
tf2 = logical
   0

jt2.Index
ans = 
'5.1'

Cleanup

Clear the open requirement sets and link sets, and close the open models without saving changes.

slreq.clear;
bdclose all;

Version History

Introduced in R2020b